Skip to content

Setting session parameters from inside of the main callback (for example for 'permanent' sessions)

zby edited this page Dec 16, 2010 · 1 revision
 $env->{'psgix.session.options'}->{expires} = time + 60 * 60 * 24 * 365 * 10; # or whatever 'permanent' means for you

Or

 $req->session->options->{expires} = ...; # $req is a Plack::Request

The Plack::Session::State::Cookie expires attribute defines the default 'expires' length used when the runtime $env doesn't have one.