|
Apache HTTPD
|
#include "mod_session.h"#include "apr_lib.h"#include "apr_strings.h"#include "util_filter.h"#include "http_log.h"#include "http_request.h"#include "http_protocol.h"Go to the source code of this file.
Macros | |
| #define | SESSION_EXPIRY "expiry" |
| #define | HTTP_SESSION "HTTP_SESSION" |
Variables | ||
| struct { | ||
| apr_array_header_t * link_session_load | ||
| apr_array_header_t * link_session_save | ||
| apr_array_header_t * link_session_encode | ||
| apr_array_header_t * link_session_decode | ||
| } | _hooks | |
| static const command_rec | session_cmds [] | |
| static int *const | aplog_module_index = &( session_module.module_index) | |
| #define HTTP_SESSION "HTTP_SESSION" |
Definition at line 26 of file mod_session.c.
| #define SESSION_EXPIRY "expiry" |
Definition at line 25 of file mod_session.c.
Definition at line 637 of file mod_session.c.
Definition at line 627 of file mod_session.c.
|
static |
Get a particular value from the session.
| r | The current request. |
| z | The current session. If this value is NULL, the session will be looked up in the request, created if necessary, and saved to the request notes. |
| key | The key to get. |
| value | The buffer to write the value to. |
< Module has handled this stage.
Definition at line 267 of file mod_session.c.
|
static |
Load the session.
If the session doesn't exist, a blank one will be created.
| r | The request |
| z | A pointer to where the session will be written. |
< Module declines to handle
< Module has handled this stage.
< Module has handled this stage.
Definition at line 91 of file mod_session.c.
|
static |
Save the session.
In most implementations the session is only saved if the dirty flag is true. This prevents the session being saved unnecessarily.
| r | The request |
| z | A pointer to where the session will be written. |
< Module has handled this stage.
< Module declines to handle
< Module has handled this stage.
Definition at line 180 of file mod_session.c.
|
static |
Set a particular value to the session.
Using this method ensures that the dirty flag is set correctly, so that the session can be saved efficiently.
| r | The current request. |
| z | The current session. If this value is NULL, the session will be looked up in the request, created if necessary, and saved to the request notes. |
| key | The key to set. The existing key value will be replaced. |
| value | The value to set. |
Definition at line 296 of file mod_session.c.
|
static |
Definition at line 547 of file mod_session.c.
Definition at line 326 of file mod_session.c.
Definition at line 318 of file mod_session.c.
|
static |
Definition at line 558 of file mod_session.c.
|
static |
Definition at line 683 of file mod_session.c.
|
static |
Fixups hook.
Load the session within a fixup - this ensures that the session is properly loaded prior to the handler being called.
The fixup is also responsible for injecting the session into the CGI environment, should the admin have configured it so.
| r | The request |
< Module has handled this stage.
Definition at line 518 of file mod_session.c.
|
static |
Default identity decoding for the session.
By default, the name value pairs in the session are URLEncoded, separated by equals, and then in turn separated by ampersand, in the format of an html form.
This was chosen to make it easy for external code to unpack a session, should there be a need to do so.
This function reverses that process, and populates the session table.
Name / value pairs that are not encoded properly are ignored.
| r | The request pointer. |
| z | A pointer to where the session will be written. |
< Module has handled this stage.
< Module has handled this stage.
Definition at line 391 of file mod_session.c.
|
static |
Default identity encoding for the session.
By default, the name value pairs in the session are URLEncoded, separated by equals, and then in turn separated by ampersand, in the format of an html form.
This was chosen to make it easy for external code to unpack a session, should there be a need to do so.
| r | The request pointer. |
| z | A pointer to where the session will be written. |
< Module has handled this stage.
Definition at line 357 of file mod_session.c.
|
static |
Should the session be included within this URL.
This function tests whether a session is valid for this URL. It uses the include and exclude arrays to determine whether they should be included.
Definition at line 53 of file mod_session.c.
|
static |
Insert the output filter.
Definition at line 502 of file mod_session.c.
|
static |
Ensure any changes to the session are committed.
This is done in an output filter so that our options for where to store the session can include storing the session within a cookie: As an HTTP header, the cookie must be set before the output is written, but after the handler is run.
NOTE: It is possible for internal redirects to cause more than one request to be present, and each request might have a session defined. We need to go through each session in turn, and save each one.
The same session might appear in more than one request. The first attempt to save the session will be called
Definition at line 447 of file mod_session.c.
Definition at line 584 of file mod_session.c.
Definition at line 617 of file mod_session.c.
|
static |
Definition at line 648 of file mod_session.c.
Definition at line 606 of file mod_session.c.
Definition at line 595 of file mod_session.c.
| struct { ... } _hooks |
Definition at line 702 of file mod_session.c.
| apr_array_header_t* link_session_decode |
Definition at line 33 of file mod_session.c.
| apr_array_header_t* link_session_encode |
Definition at line 33 of file mod_session.c.
| apr_array_header_t* link_session_load |
Definition at line 33 of file mod_session.c.
| apr_array_header_t* link_session_save |
Definition at line 33 of file mod_session.c.
|
static |
Definition at line 663 of file mod_session.c.