Re: [Cgi-session-user] Trouble with C::S::SQLite
Brought to you by:
sherzodr
From: Puneet K. <pu...@ei...> - 2006-03-06 21:22:21
|
Mark Stosberg wrote: > On Mon, Mar 06, 2006 at 03:01:06PM -0600, Puneet Kishor wrote: >> Mark, any suggestions how/what debugging to turn on besides the usual >> diagnostics and -w? Actually, I also ran the script through the debugger >> but wasn't any wiser. I should have added my code snippet in the above >> email in the first place... this is what I am doing (simplified just a >> tad bit) -- >> >> $DBH = DBI->connect("dbi:SQLite:dbname=/path/to/my.db") or die; > > Using this $DBH handle, you can access the session table directly, > outside of CGI::Session? > > my @row = $DBH->selectrow_array("SELECT * FROM sessions"); > use Data::Dumper; > warn Dumper (\@row); > that works just fine (well, a variation of the above). Here is what I did... inserted a couple of rows into "sessions" sqlite> .schema sessions CREATE TABLE 'sessions' ( id CHAR(32) NOT NULL PRIMARY KEY, a_session TEXT NOT NULL ); sqlite> select * from sessions; sqlite> insert into sessions (id, a_session) values (1, "foo"); sqlite> insert into sessions (id, a_session) values (2, "bar"); sqlite> select * from sessions; 1|foo 2|bar sqlite> Then, in my script, after the session statements... my @row = $DBH->selectrow_array("SELECT * FROM sessions"); .. $T->param( TMP => join(",", @row), ); And, in my template <TMPL_VAR TMP>. In my web page I got... 1,foo and in my error log I got the same session error as above. > > Also, you may want to 'grep' the test suite shipped with CGI::Session to > see the syntax that we are using with SQLite that is known to work. Ok, I will look at that, but isn't new CGI::Session("driver:sqlite", $sid, {Handle=>$DBH}) the correct syntax, as noted in the documentation? Thanks. -- Puneet Kishor |