Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: CGI Session

by Abigail-II (Bishop)
on Jun 23, 2004 at 16:48 UTC ( #369111=note: print w/replies, xml ) Need Help??

in reply to CGI Session

Just as the error message says, you don't have the module DB_File installed, or not properly installed. It seems to be a requirement for the CGI::Session module that you are using.


Replies are listed 'Best First'.
Re^2: CGI Session
by shaolindoman (Acolyte) on Jun 23, 2004 at 17:24 UTC
    I;m sorry I thought that I had installed that. I must have installed the wrong thing. Thanks for your help.
Re^2: CGI Session
by shaolindoman (Acolyte) on Jun 23, 2004 at 17:34 UTC
    Ok, now I'm getting this error: <code> (in cleanup) could not flush: Couldn't store ab4a75f8bddea52a28b08e0880a 41d41 into \tmp\cgisess_ab4a75f8bddea52a28b08e0880a41d41: No such file or direct ory at login.cgi line 0 <code> which seems to undicate I havn't created the direcotry. But I have the direcotry /tmp created so I'm curious what the problem is here. This directory: cgisess_ab4a75f8bddea52a28b08e0880a41d41 is supposed to be created inside of /tmp, correct? (to keep track of the session of that particular user)
      /tmp is an unlikely directory to have on Windows. Make sure there is a \tmp on the same drive as the web site (c:\tmp or d:\tmp) and that it is writable by the web server.
Re^2: CGI Session
by shaolindoman (Acolyte) on Jun 23, 2004 at 18:26 UTC
    Well, here is my complete code that is generating this error:
    use Data::Dumper; use CGI::Session; use CGI; my $cgi = new CGI; my $session = new CGI::Session(undef, $cgi, {Directory=>"\tmp" +}); $cookie = $cgi->cookie(CGISESSID => $session->id ); print $cgi->header(-cookie=>$cookie);
    With New error:
    (in cleanup) could not flush: Couldn't store 4206b0c8bba60b524 +6ced512c58 f5481 into mp\cgisess_4206b0c8bba60b5246ced512c58f5481: Invalid a +rgument at login.cgi line 0
    It seems like it won't create a session basically which I'm not sure why. I've searched the net and everywhere else and havn't found anyone with a similar problem (except one German site I couldn't read hehe). Any ideas? I'm going nuts trying to figure this out.

      \t inside doulbe quotes becomes a tab. Use "/tmp" instead. Where in your file system did you create the tmp folder?

      Eric Hodges

      As was mentioned above, you have to give it a valid directory path. \tmp is probably not a valid directory path. For example, if you want your session files stored in a directory called SESSION located in the root of your C drive, make the directory there and use:

      my $session = new CGI::Session(undef, $cgi, {Directory=>"C:\\SESSION"});    

      Eric put his finger on it - \t within double-quotes is a tab. (If you look closely at the error message, you'll see blank space -- the tab -- where the "\t" should be.) Change your code to this:

      my $session = new CGI::Session(undef, $cgi, {Directory=>'\tmp'});

      and try again.

      Wally Hartshorn

        Thanks guys for your help. It is working fine now.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://369111]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2021-12-04 16:37 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (30 votes). Check out past polls.