I have used cgi-session successfully online in a unix environment. I am =
redeveloping the script and testing first in my Windows XP IIS =
ActiveState Perl environment. In this environment I am not able to save =
a session either to a flat file or to MySQL. Here is the relevant code
use CGI::Carp qw(fatalsToBrowser carpout);
use CGI qw(header cookie);
use CGI::Session;
use DBI;
.........................................................................=
...................
$sidInfo =3D $q->cookie("InfoSession") || $q->param("InfoSession") || =
undef;
$value{'Debug'} =3D "---".$sidInfo;
$dbh =3D DBI->connect("DBI:mysql:$db:$hostname:$port", $user, =
$password,\%attr);
$sI =3D new CGI::Session( "driver:MySQL", $sidInfo, { Handle=3D>$dbh =
});
#$sI =3D new CGI::Session(undef, $sidInfo, {Directory=3D>'tmp'});
$sidInfo =3D $sI->id;
$value{'Debug'} .=3D "---".$sidInfo."---";
Every time I refresh the page a new session id is generated. For =
example, the outputted debug value shows=20
---4451a04055dceee31a8c46b31c54a5c6---59855cc334f037adc84153218c686756---=
---59855cc334f037adc84153218c686756---adedd7e8b9721b7a925d976815d7767f---=
in successive updates.
When I had the flat file storage active, no file was created and now =
with MySQL no records are added to the table that I created per =
instructions in the application's database. The database handle is =
successfully used to get data from other tables. There are no error =
messages. I am not using the standard session name because I also have a =
session to store customer information (as opposed to this order =
information). I have not uploaded this yet to try on my public server.
Any experience with this environment that might help me here, either in =
solving the problem or adding more debugging?
thanks
Henry
|