[Catalyst] Session unexpectedly expiring

Jeff Chimene jchimene at gmail.com
Mon May 21 18:00:46 GMT 2007


James R. Leu wrote:
> Not really related to your issue specifically, but I have seen
> issues with using Session::Store::FastMmap and perl ithreads resulting
> in unrelated sessions appearing to terminate when a thread 'joins'
> back to the parent.  I think is has something to do with ithreads
> interaction with shared memory.  My fix was to not use shared memory :-)
>   
OK, but this is a development machine, and I'm the only user. AFAIK, I'm
not using ithreads. As I mentioned, disabling the auto() method in
Root.pm seems to have solved the issue:
http://www.mail-archive.com/catalyst@lists.rawmode.org/msg05457.html

Cheers,
jec
> On Mon, May 21, 2007 at 08:52:16AM -0700, Jeff Chimene wrote:
>   
>> Jeff Chimene wrote:
>>     
>>> Hi,
>>>
>>> I'm trying to figure out why my sessions are expiring in
>>> script/xxx_cgi.pl but not script/xxx_server.pl
>>> The desired cycle is to login then redirect to another controller.
>>>
>>> When I run the standalone server, the session state is recovered, and
>>> control resumes with the next controller.
>>>
>>> When I run using Apache & the script/xxx_cgi.pl, the session state is
>>> marked expired and control returns to the login controller.
>>>
>>> I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
>>> plugins.
>>>
>>> Thanks for your support!
>>>
>>> Cheers,
>>> jec
>>>       
>> This has something to do w/ the implementation of the "auto" method in
>> Root.pm
>>
>> There's some "extra" stuff I added to support returning to the requested
>> URI after
>> login. Nevertheless, it works from script/aic_server.pl, but not from
>> Apache.
>>
>> Anyway, I disabled the routine and received goodness from Apache.
>>
>> sub auto : Private
>>   {
>>     my ($self, $c) = @_;
>>
>>     if ($c->controller eq $c->controller('Login')) {
>>       return 1;
>>     }
>>
>>     # If a user doesn't exist, force login
>>     $c->session->{after_login} = '';
>>     if (!$c->user_exists) {
>>       $c->log->debug('***Root::auto User not found, forwarding to
>> /login') if $c->debug;
>>
>>       # make sure we return here after a successful login
>>       $c->session->{after_login} = $c->request->uri() unless
>> ($c->request->uri() eq $c->request->base());
>>       $c->detach('aic::Controller::Login', 'index');
>>     }
>>
>>     # User found, so return 1 to continue with processing after this 'auto'
>>     return 1;
>>   }




More information about the Catalyst mailing list