This is a VERY basic question regarding sessions with CGI. I have some
code below that I would expect to look for a cgi::cookie with a session
ID from a previous visit. If the cookie exists, use the session ID
from the cookie, otherwise the session ID is undefined and C::A::P::S
makes a new session. However, it seems that I get a new session with
each visit to the page (my first runmode does contain a call to
$self->session, which I understand will generate the cookie). I am
missing some important concept here, but just can't figure out what.
Can someone enlighten me a bit?
sub setup {
my $self=shift;
$self->start_mode('query_text');
$self->mode_param('rm');
$self->run_modes(
'query_text' => 'text_query',
# 'query_location' => 'text_query',
# 'query_GO' => 'text_query',
# 'query_exprs' => 'text_query',
'return_results' => 'return_results',
'do_heatmap' => 'do_heatmap',
'mode4' => 'return_graphical_results',
);
$self->param('dbh' => DBI->connect($dsnnlt,
$nltuser,
$nltpass
))
or croak "Database connection not made: $DBI::errstr";
my $sid = $self->query->cookie("CGISESSID") || undef;
$self->session_config(
CGI_SESSION_OPTIONS => ['driver:MySQL',$sid,
{Handle=>$self->param('dbh')}],
COOKIE_PARAMS => {
-domain => 'nih.gov',
-expires => '+12h',
-path => '/',
},
SEND_COOKIE => 1,
);
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]