</usage>
</directivesynopsis>
+<directivesynopsis>
+<name>SessionCookieMaxAge</name>
+<description>Control whether session cookies have Max-Age transmitted to the client</description>
+<syntax>SessionCookieMaxAge On|Off</syntax>
+<default>SessionCookieMaxAge On</default>
+<contextlist><context>server config</context>
+<context>virtual host</context>
+<context>directory</context>
+<context>.htaccess</context>
+</contextlist>
+<override>AuthConfig</override>
+
+<usage>
+ <p>The <directive>SessionCookieMaxAge</directive> flag controls whether
+ the session expiration will be specified in the Max-Age attribute on the
+ cookie sent to the client. When set to 'Off', the attribtue will not be
+ added and clients will only return the cookie until "the current
+ session is over". This often means until the browser is closed. </p>
+
+ <p>The expiration of the session is still validated on the server by
+ the <directive module="mod_session">SessionMaxAge</directive> directive.
+ </p>
+
+</usage>
+</directivesynopsis>
+
+
</modulesynopsis>
const char *name2_attrs;
int remove;
int remove_set;
+ int maxage;
+ int maxage_set;
} session_cookie_dir_conf;
/**
session_cookie_dir_conf *conf = ap_get_module_config(r->per_dir_config,
&session_cookie_module);
+ int maxage = conf->maxage ? z->maxage : 0;
/* create RFC2109 compliant cookie */
if (conf->name_set) {
if (z->encoded && z->encoded[0]) {
ap_cookie_write(r, conf->name, z->encoded, conf->name_attrs,
- z->maxage, r->err_headers_out,
+ maxage, r->err_headers_out,
NULL);
}
else {
if (conf->name2_set) {
if (z->encoded && z->encoded[0]) {
ap_cookie_write2(r, conf->name2, z->encoded, conf->name2_attrs,
- z->maxage, r->err_headers_out,
+ maxage, r->err_headers_out,
NULL);
}
else {
{
session_cookie_dir_conf *new =
(session_cookie_dir_conf *) apr_pcalloc(p, sizeof(session_cookie_dir_conf));
+ new->maxage = 1;
return (void *) new;
}
new->name2_set = add->name2_set || base->name2_set;
new->remove = (add->remove_set == 0) ? base->remove : add->remove;
new->remove_set = add->remove_set || base->remove_set;
+ new->maxage = (add->maxage_set == 0) ? base->maxage : add->maxage;
+ new->maxage_set = add->maxage_set || base->maxage_set;
return new;
}
return NULL;
}
+static const char *
+ set_maxage(cmd_parms * parms, void *dconf, int flag)
+{
+ session_cookie_dir_conf *conf = dconf;
+
+ conf->maxage = flag;
+ conf->maxage_set = 1;
+
+ return NULL;
+}
static const command_rec session_cookie_cmds[] =
{
AP_INIT_RAW_ARGS("SessionCookieName", set_cookie_name, NULL, RSRC_CONF|OR_AUTHCFG,
AP_INIT_FLAG("SessionCookieRemove", set_remove, NULL, RSRC_CONF|OR_AUTHCFG,
"Set to 'On' to remove the session cookie from the headers "
"and hide the cookie from a backend server or process"),
+ AP_INIT_FLAG("SessionCookieMaxAge", set_maxage, NULL, RSRC_CONF|OR_AUTHCFG,
+ "Set to 'Off' to disable propogating SessionMaxAge to the client"),
+
{NULL}
};