Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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.

Abigail


Comment on Re: CGI Session
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.

      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"});    
      

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


      ___________
      Eric Hodges

      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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2015-07-03 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (51 votes), past polls