But you did not post the correction/solution =)

sorry about that. The resolution was to re-read the section of the cgi::session documentation which talks about the data table.


"Session data is stored in the form of hash table, in key value pairs...."

I thought that the first argument to the param method was the column name. It is actually the hash name. I didn't need to create a new column. That data was being stored in the a_session column already.

I do have another question about cgi::session though. this login script creates a session object ONLY if authentication succeeded. the user is then redirected to the originally requested url (another perl script). I can't figure out how I can validate the provided sessionID WITHOUT creating a new session record in the database. Is it possible to do so using methods provided by the library?

I ended up having to do the following:

## redirect to login if no session id
if (!$q->cookie("CGISESSID")) {
print $q->redirect(-uri=>'https://hostname/cgi-bin/login.cgi',-status=>302)};
my $sid = $q->cookie("CGISESSID") || undef;
my $session = new CGI::Session("driver:MySQL", $sid, {Handle=>$s_dbh});
## created a new session means bad sessionID. redirect to login
if ($session->id() ne $sid) {
$session->expire('+1s'); # will want to delete this actually
print $q->redirect(-uri=>'https://hostname/cgi-bin/login.cgi',-status=>302);
}


_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/



-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to