httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <>
Subject Re: How do I get hold of session information?
Date Wed, 20 Oct 2010 12:30:09 GMT
On Wed, Oct 20, 2010 at 8:05 AM, Paul Donaldson
<> wrote:
> For example, the mod_session page states:
> Creating a session is as simple as turning the session on, and deciding where
> the session will be stored. In this example, the session will be stored on the
> browser, in a cookie called session.
> Browser based session
> Session On
> SessionCookieName session path=/
> But it doesn't say where or how to do this. I'm sure everyone in this group will
> take that sort of thing for granted, but it's infuriating for those of us coming
> to Apache Modules for this first time.
> The page also mentions the SessionEnv directive:
> If set to On, the SessionEnv directive causes the contents of the session to be
> written to a CGI environment variable called HTTP_SESSION.
> but it'd be great if there was some documentation somewhere that said where to
> set this,

This would be a new to Apache as a user FAQ and not a new to module
development FAQ.

Each directive tells you the context it's valid in:

Then you find a home for it in your configuration file based on where
you want the directive applied.

> and how to read it from another module, assuming that this environment
> variable is in fact the only way to get hold of the session information in my
> module. It can't possibly be an environment variable in the true sense
> (getenv...) as there may be thousands of requests hitting the server.

When modules talk about environment variables,  they usually mean the
internal table of variables in r->subprocess_env.

It looks like mod_session has an API defined in and used by
mod_auth_form -- I'd probably start there.

View raw message