httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian McQueen <mcqueenor...@gmail.com>
Subject Re: cookie handling functions
Date Wed, 15 Sep 2010 16:46:23 GMT
I think apreq has that.  If you don't have it already, get it and
you'll be glad you did.  Look at its header files.  Lots of good stuff
in them.

On Wed, Sep 15, 2010 at 9:34 AM, Neil Erdwien <neil@k-state.edu> wrote:
> I'm writing a filter module that needs to inspect cookie values sent with
> the request.
>
> Getting the cookie string is easy via:
>
>   char *s = apr_table_get(r->headers_in, "cookie");
>
> However, this returns the whole cookie string, i.e., something like:
>
>   name=value; name="value"; name="quoted \"value\""
>
> Possibly with $Version, $Path, etc.  RFC 2965 is the spec.
>
> I can write code to parse that out, but...
>
> 1.  It is tedious.
>
> 2.  Surely this has been done.  Are there functions somewhere inside Apache
> HTTPD, and accessible from a filter, that will do something like:
>
>   char *value = get_cookie(r, "cookiename");
>
> 3.  Whatever is already coded will probably more faithfully implement the
> RFC than what I cook up.
>
> --
> Neil Erdwien, neil@k-state.edu, 785-532-4905
> Web Technologies Manager
> Office of Mediated Education, Kansas State University
>

Mime
View raw message