in reply to Re^2: CGI::Session - non-stop session creation problem
in thread CGI::Session - non-stop session creation problem
I take it you didn't like my previous solution. I'm not entirely sure why.
What still is not clear to me is how you determine whether someone is logged in or not. If that is just by the existance of the "main" cookie, then "is_logged_in()" is simply the existance of $sid:my $sid = $foo->cookie('main') || undef; my $session; # = undef if (is_logged_in()) { $session = CGI::Session->new(undef, $sid, {Directory => 'c:/apache/s +essions'}); }
Of course, in the code that logs in, you'll need to create a new session at that time, so you have a sid to put into the main cookie. But I don't think that's the problem you're having (yet).my $sid = $foo->cookie('main') || undef; my $session; # = undef if (defined $sid) { $session = CGI::Session->new(undef, $sid, {Directory => 'c:/apache/s +essions'}); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: CGI::Session - non-stop session creation problem
by Stenyj (Beadle) on Apr 07, 2005 at 04:52 UTC | |
by Tanktalus (Canon) on Apr 07, 2005 at 16:49 UTC | |
by ikegami (Patriarch) on Apr 08, 2005 at 05:58 UTC | |
by Stenyj (Beadle) on Apr 07, 2005 at 22:28 UTC |