[Catalyst] restore session manually

Charlie Garrison garrison at zeta.org.au
Mon Jul 5 09:30:28 GMT 2010


Good evening,

On 5/07/10 at 9:31 AM +0200, Bernhard Bauch <bauch at zsi.at> wrote:

>ah..
>i think more important is to restore the users session..
>to have $c->user() available after getting the session parameter...
>so maybe i need to hook into - or call a function of - Catalyst-Plugin-Authentication ?

That seems to be over-complicating the problem. The Session 
plugins already handle all of that, so either use one of the 
existing Session::State plugins or create your own. Then all the 
session/user/etc stuff should 'just work'.

Restoring the session some other way (later in the execution 
cycle) is asking for problems when some part of your app is 
expecting the session to already be restored, before your upload 
action has a chance to do it. Eg. if request requires 
authenticated user for the upload action, and user is restored 
along with the session, and session/user is restored from the 
upload action ..... pain ensues.

Charlie

-- 
    Ꮚ Charlie Garrison ♊ <garrison at zeta.org.au>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt



More information about the Catalyst mailing list