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'}); }
In reply to Re^3: CGI::Session - non-stop session creation problem
by Tanktalus
in thread CGI::Session - non-stop session creation problem
by Stenyj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |