*** UserSessionCookie.pm Tue Jan 4 23:44:47 2005 --- /usr/local/lib/perl5/site_perl/5.8.5/Maypole/Plugin/Authentication/UserSessionCookie.pm Mon Jan 31 10:37:15 2005 *************** use strict; *** 3,8 **** --- 3,9 ---- use warnings; our $VERSION = '1.6'; use CGI::Simple::Cookie; + use URI; Maypole::Config->mk_accessors('auth'); Maypole->mk_accessors(qw/user session/); *************** sub login_user { *** 104,109 **** --- 105,111 ---- # Store the userid, and bake the cookie $session{uid} = $uid if $uid and not exists $session{uid}; warn "Session's uid is $session{uid}" if $r->debug; + unless ($sid ) { my $cookie_name = $r->config->auth->{cookie_name} || "sessionid"; my $cookie = CGI::Simple::Cookie->new( -name => $cookie_name, *************** sub login_user { *** 113,118 **** --- 115,121 ---- ); warn "Baking: ". $cookie->as_string if $r->debug; $r->headers_out->set("Set-Cookie",$cookie->as_string()); + } $r->session(\%session); return 1; } *************** sub _logout_cookie { *** 191,197 **** my $r = shift; my $cookie = CGI::Simple::Cookie->new( -name => $r->config->auth->{cookie_name} || "sessionid", ! -value => undef, -path => URI->new($r->config->uri_base)->path, -expires => "-10m" ); --- 194,200 ---- my $r = shift; my $cookie = CGI::Simple::Cookie->new( -name => $r->config->auth->{cookie_name} || "sessionid", ! -value => 0, -path => URI->new($r->config->uri_base)->path, -expires => "-10m" );