[Catalyst] Force the session to be saved.

Hernan Lopes hernanlopes at gmail.com
Tue Mar 29 18:19:22 GMT 2011


if your problem is delay javascript, or start script after any amount of
seconds try:
<script>
setTimeout( 'alertme();' , 1500 );
function alertme () {
    alert(' time is up! ');
}
</script>

--Hernan

On Tue, Mar 29, 2011 at 2:46 PM, Duncan Garland <
Duncan.Garland at motortrak.com> wrote:

> Hi,
>
>
>
> We=92ve been having some peculiar behaviour from our system. I think it=
=92s
> 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. Occasiona=
lly
> the first controller hasn=92t 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 render=
ed.
>
>
>
> Something like:
>
>
>
> $c->session->{javascript}->{$template}  =3D { one =3D 1, two =3D> 2};
>
> $c->session->save;
>
>
>
> Is there such a method?
>
>
>
> Regards
>
>
>
> Duncan
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110329/b8340=
4f3/attachment.htm


More information about the Catalyst mailing list