Subject: | Logout behaviour differs from docs |
The docs state that by default, the user will be logged out at the end of the current session. In fact, by default the user gets a cookie with a 3 month lifetime. This patch gives the default behaviour as documented:
$ diff -u UserSessionCookie.pm UserSessionCookie.pm.patched
--- UserSessionCookie.pm Wed Jan 5 15:02:06 2005
+++ UserSessionCookie.pm.patched Wed Sep 7 07:54:58 2005
@@ -105,11 +105,13 @@
$session{uid} = $uid if $uid and not exists $session{uid};
warn "Session's uid is $session{uid}" if $r->debug;
my $cookie_name = $r->config->auth->{cookie_name} || "sessionid";
+ my %expires = ( -expires => $r->config->auth->{cookie_expiry} )
+ if exists $r->config->auth->{cookie_expiry};
my $cookie = CGI::Simple::Cookie->new(
-name => $cookie_name,
-value => $session{_session_id},
- -expires => $r->config->auth->{cookie_expiry} || '+3M',
- -path => URI->new($r->config->uri_base)->path
+ -path => URI->new($r->config->uri_base)->path,
+ %expires,
);
warn "Baking: ". $cookie->as_string if $r->debug;
$r->headers_out->set("Set-Cookie",$cookie->as_string());