Re: [Cgi-session-user] Session form field data not camptured by database (mssql)
Brought to you by:
sherzodr
From: Lee C. <lec...@ya...> - 2010-01-11 20:28:37
|
Hello Peter, Have you tried to manually flush the session? http://search.cpan.org/dist/CGI-Session/lib/CGI/Session.pm#flush%28%29 http://search.cpan.org/dist/CGI-Session/lib/CGI/Session.pm#A_Warning_about_Auto-flushing Maybe something is happening w/ the MSSQL dbh handle that isn't allowing it to autoflush. Take Care, Lee ----- Original Message ---- > From: Peter Munoz <pm...@be...> > To: cgi...@li... > Sent: Mon, January 11, 2010 11:51:26 AM > Subject: [Cgi-session-user] Session form field data not camptured by database (mssql) > > 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 "; > print "My sid is $sid "; > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Cgi-session-user mailing list > Cgi...@li... > https://lists.sourceforge.net/lists/listinfo/cgi-session-user |