Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
more useful options
 
PerlMonks  

Re^5: having problems w/CGI-Session

by MrCromeDome (Deacon)
on May 24, 2005 at 22:44 UTC ( [id://460216]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^4: having problems w/CGI-Session
in thread having problems w/CGI-Session

Thank you, I like being mistaken in that way :)

You might want to consider using CGI::Application::Plugin::Session. All that code you have could be boiled down to the following:
use CGI::Application::Plugin::Session; my %options = ( Directory => "/ctrlacc/lhdsurv/session/mid_yr_rpt_survey" ); $self->session_config( CGI_SESSION_OPTIONS => [ undef, $self->query, \%options ], SEND_COOKIE => 1, );
and it would be more readable. I typically throw that in the cgiapp_init() method of my CGI::Application base class, but if you wanted to throw it in it's own function it's probably alright.

And I've never had any luck setting expiration times with CGI::Session. They never work for me. Either don't expire the cookie, or set it to expire as soon as the browser closes.

Good luck, I hope this helps!
MrCromeDome

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://460216]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.