[Catalyst] Force the session to be saved.

Duncan Garland Duncan.Garland at motortrak.com
Tue Mar 29 17:46:32 GMT 2011


We've been having some peculiar behaviour from our system. I think it's because the controller which produces the HTML page stores data in the session for retrieval by the controller which produces the associated javascript file.

The client begins processing the HTML page as soon as it starts to arrive. When it reaches the script tag it requests the javascript page. Occasionally the first controller hasn't written the session to the database when the javascript controller tries to retrieve it. (Catalyst::Plugin::Session::Store::DBIC).

I can move the script tag down the page a bit, but what I really need is a way to force the session to be written before the HTML template is rendered.

Something like:

$c->session->{javascript}->{$template}  = { one = 1, two => 2};

Is there such a method?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110329/567fecb2/attachment.htm

More information about the Catalyst mailing list