25#define SESSION_EXPIRY "expiry"
26#define HTTP_SESSION "HTTP_SESSION"
56 const char **includes = (
const char **) conf->includes->elts;
57 const char **excludes = (
const char **) conf->excludes->elts;
61 if (conf->includes->nelts) {
63 for (
i = 0; !
included &&
i < conf->includes->nelts;
i++) {
71 if (conf->excludes->nelts) {
72 for (
i = 0;
included &&
i < conf->excludes->nelts;
i++) {
101 if (!dconf || !dconf->
enabled) {
108 "excluded by configuration for: %s",
r->
uri);
116 "session is enabled but no session modules have been configured, "
117 "session not loaded: %s",
r->
uri);
122 "error while loading the session, "
123 "session not loaded: %s",
r->
uri);
138 "error while decoding the session, "
139 "session not loaded: %s",
r->
uri);
144 if (
zz &&
zz->expiry &&
zz->expiry <
now) {
193 "attempt made to save the session twice, "
194 "session not saved: %s",
r->
uri);
197 if (
z->expiry &&
z->expiry <
now) {
199 "attempt made to save a session when the session had already expired, "
200 "session not saved: %s",
r->
uri);
211 if (
z->dirty &&
z->maxage) {
222 if (!
z->dirty && !
z->maxage) {
230 "error while encoding the session, "
231 "session not saved: %s",
r->
uri);
239 "session is enabled but no session modules have been configured, "
240 "session not saved: %s",
r->
uri);
245 "error while saving the session, "
246 "session not saved: %s",
r->
uri);
268 const char *
key,
const char **
value)
277 if (
z &&
z->entries) {
395 char *encoded, *
pair;
396 const char *
sep =
"&";
408 const char *
psep =
"=";
464 if (!
z ||
z->written) {
478 z->encoded =
override;
575 ?
base->expiry_update_time
654 return "SessionExpiryUpdateInterval must be zero (disable) or a positive value";
666 "on if a session should be maintained for these URLs"),
668 "length of time for which a session should be valid. Zero to disable"),
670 "output header, if present, whose contents will be injected into the session."),
672 "on if a session should be written to the CGI environment. Defaults to off"),
674 "URL prefixes to include in the session. Defaults to all URLs"),
676 "URL prefixes to exclude from the session. Defaults to no URLs"),
678 "time interval for which a session's expiry time may change "
679 "without having to be rewritten. Zero to disable"),
APR general purpose library routines.
apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second)
#define AP_INIT_TAKE1(directive, func, mconfig, where, help)
#define ap_get_module_config(v, m)
#define AP_DECLARE_MODULE(foo)
#define AP_INIT_FLAG(directive, func, mconfig, where, help)
apr_status_t ap_pass_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket)
ap_filter_rec_t * ap_register_output_filter(const char *name, ap_out_filter_func filter_func, ap_init_filter_func filter_init, ap_filter_type ftype)
ap_filter_t * ap_add_output_filter(const char *name, void *ctx, request_rec *r, conn_rec *c)
void ap_remove_output_filter(ap_filter_t *f)
void ap_hook_insert_error_filter(ap_HOOK_insert_error_filter_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
void ap_hook_fixups(ap_HOOK_fixups_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
void ap_hook_insert_filter(ap_HOOK_insert_filter_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
#define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ns, link, ret, name, args_decl, args_use, decline)
#define APR_HOOK_LINK(name)
#define APR_HOOK_STRUCT(members)
#define APR_HOOK_REALLY_FIRST
#define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ns, link, ret, name, args_decl, args_use, ok, decline)
#define APR_HOOK_REALLY_LAST
#define APR_REGISTER_OPTIONAL_FN(name)
int ap_run_session_load(request_rec *r, session_rec **z)
int ap_run_session_save(request_rec *r, session_rec *z)
void ap_hook_session_encode(ap_HOOK_session_encode_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
int ap_run_session_decode(request_rec *r, session_rec *z)
void ap_hook_session_decode(ap_HOOK_session_decode_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
int ap_run_session_encode(request_rec *r, session_rec *z)
#define STANDARD20_MODULE_STUFF
char * ap_escape_urlencoded_buffer(char *c, const char *s)
int ap_unescape_urlencoded(char *query)
const char apr_int32_t flag
apr_vformatter_buff_t const char va_list ap
#define apr_pcalloc(p, size)
#define apr_time_from_sec(sec)
static int session_fixups(request_rec *r)
static const char * add_session_exclude(cmd_parms *cmd, void *dconf, const char *f)
static apr_status_t ap_session_load(request_rec *r, session_rec **z)
static const char * set_session_env(cmd_parms *parms, void *dconf, int flag)
static void * merge_session_dir_config(apr_pool_t *p, void *basev, void *addv)
static const char * set_session_enable(cmd_parms *parms, void *dconf, int flag)
static apr_status_t ap_session_get(request_rec *r, session_rec *z, const char *key, const char **value)
static int session_identity_encode(request_rec *r, session_rec *z)
static const command_rec session_cmds[]
static const char * set_session_expiry_update(cmd_parms *parms, void *dconf, const char *arg)
static apr_status_t ap_session_save(request_rec *r, session_rec *z)
static void session_insert_output_filter(request_rec *r)
static int identity_count(void *v, const char *key, const char *val)
static int session_identity_decode(request_rec *r, session_rec *z)
static void register_hooks(apr_pool_t *p)
static int identity_concat(void *v, const char *key, const char *val)
static const char * set_session_maxage(cmd_parms *parms, void *dconf, const char *arg)
static void * create_session_dir_config(apr_pool_t *p, char *dummy)
static apr_status_t session_output_filter(ap_filter_t *f, apr_bucket_brigade *in)
static const char * set_session_header(cmd_parms *parms, void *dconf, const char *arg)
static int session_included(request_rec *r, session_dir_conf *conf)
static const char * add_session_include(cmd_parms *cmd, void *dconf, const char *f)
static apr_status_t ap_session_set(request_rec *r, session_rec *z, const char *key, const char *value)
Session Module for Apache.
The representation of a filter chain.
A structure that represents the current request.
apr_table_t * err_headers_out
apr_table_t * subprocess_env
struct ap_conf_vector_t * per_dir_config
apr_table_t * headers_out
apr_time_t expiry_update_time
apr_array_header_t * includes
apr_array_header_t * excludes