[Cgi-session-user] Session form field data not camptured by database (mssql)
Brought to you by:
sherzodr
From: Peter M. <pm...@be...> - 2010-01-11 17:51:36
|
Hello I have a cgi sessions problem that i can not figure out, i was hoping someone could take a look at it and maybe point me in the right direction. My problem occurs when i(sessions) write to the database(MSSQL), i know i can connect and write to the database, but for some reason or another none of my form fields are being captured and written to the database table, it almost looks like it gets cut off . The only thing that gets written to the database session table is the "_session_id" and "_session_Atime". Here is what gets written to the database table "sessions" in the "_a_session" field. $D = {'_SESSION_ID' => 'c035a6cc9acee1417507a89dc139a6cc','_SESSION_ATIME' => 12 I would expect to see something like this(these are the results if i write to a text file, mysql,or pgdb)... $D = {'email' => undef,'_SESSION_ID' => 'f54d371a4bede56d55b77777d152b9f15dd','_SESSION_ATIME' => 1262913258,'_SESSION_REMOTE_ADDR' => '127.0.0.1','_SESSION_EXPIRE_LIST' => {},'name' => 'Peter','_SESSION_CTIME' => 1262913230};;$D Thank you for taking the time, any advise would be great Thank you -pm Here is my code #!/usr/bin/perl use CGI::Carp qw( fatalsToBrowser ); use CGI::Session; use CGI; use DBI; use Time::Local; use Tie::IxHash; use DBD::Sybase; my $session; my $cgi = new CGI; require CGI::Session::Driver::DBI; @ISA = qw( CGI::Session::Driver::DBI ); my $dbname="dbname"; my $host="server:port"; my $db_user="user"; my $db_pass="password"; my $db_driver="sybase"; #my $connectionInfo="dbi:$db_driver:$host:$dbname"; #establish a database connection $dbh = DBI->connect($connectionInfo,$db_user, $db_pass) || "Can't connect to $dbname: $DBI::errstr"; #set the sesssion and what session driver to use $session = new CGI::Session("driver:odbc", $cgi, {Handle=>$dbh, TableName => 'CollectorDev.dbo.sessions'}); #Define cookie that with the same session id that is in the databse, so we can referrence this record my $cookie = $cgi->cookie(-name=>'CGISESSID', -value=>$session->id, -expires=>'+1d'); #set the cookie/session on the users station (computer) print $cgi->header(-cookie=>$cookie); my $sid = $session->id(); ############################################################### $name = $cgi->param("name"); $session->param(name, $name); $name = $session->param("name"); print "My name is $name <BR>"; print "My sid is $sid <BR>"; |