Giter VIP home page Giter VIP logo

http_set_cookie_parser's Introduction

http_set_cookie_parser

This program recieves HTTP\1.1 response messages via standard input and parses Set-Cookie headers only. It will stop reading when the end of file (EOF) is reached. Within a terminal, EOF can be forced by pressing ctrl+d two times.

Details: This parser only cares about the Set-Cookie headers within HTTP\1.1 responce messages. Furthermore, it is only concerned with the name and value of the Set-Cookie header. It will ignore other directives such as Max-Age, Expires, etc. If multiple Set-Coookie headers are recieved with the same name, the value of the most recent Set-Cookier header will replace the value of the oldest.

Sample input is provided below:

HTTP/1.1 404 Not Found Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 Set-Cookie: Username=Test123 Connection: Closed Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 404 Not Found Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 Set-Cookie: sessionId=38afes7a8 Set-Cookie: helloWorld=fes7a8; Expires=Tues, 21 Oct 2019 09:30:00 GMT Connection: Closed Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 100 OK Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 Set-Cookie: UN=HelloWorld Connection: Closed Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 404 Not Found Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 Set-Cookie: HELLO_WORLD=hello_world Connection: Closed Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 100 OK Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 Set-Cookie: lastName=Smith Connection: Closed Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 100 OK Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 Set-Cookie: SessionID=12345 Set-Cookie: SessionID=abcdef Set-Cookie: SessionID=a1b2c3d4;Expires=Wed, 21 Oct 2015 07:28:00 GMT Set-Cookie: SessionID=1a2b3c4d Set-Cookie: SessionID=11aa22bb33cc; Domain=somecompany.co.uk Set-Cookie: SessionID=qwerty12345; Max-Age:45 Connection: Closed Content-Type: text/html; charset=iso-8859-1

http_set_cookie_parser's People

Contributors

cameronpkeith avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.