in reply to Re^5: CGI::Session Compilation Issues
in thread CGI::Session Compilation Issues

Not a permissions issue else the perl script would have failed.
use English; use Cwd qw(getcwd); use CGI qw/:standard/; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); #-- ppm install CGI::Session use CGI::Session; our $session; our $query = new CGI(); our $perl_sessions = "C:/webtmp"; if (!(defined($query->cookie("wweb")))) { $session = new CGI::Session("driver:File", undef, {Directory=> +$perl_sessions}); $cookie = $query->cookie(-name => "wweb", -value => $session->id); } exit(0);

Replies are listed 'Best First'.
Re^7: CGI::Session Compilation Issues
by Corion (Patriarch) on Feb 22, 2010 at 21:01 UTC

    My bet still is on the permission issue. Reading the CGI::Session documentation for ->new, it points to the ->errstr class method as a way of finding why the constructor might fail. So, why aren't you checking errors? What does the following write to the error log and/or output?

    use strict; #use English; use Cwd qw(getcwd); use CGI qw/:standard/; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); #-- ppm install CGI::Session use CGI::Session; our $session; our $query = new CGI(); our $perl_sessions = "C:/webtmp"; if (!(defined($query->cookie("wweb")))) { $session = new CGI::Session("driver:File", undef, {Directory=> +$perl_sessions}) or die "Couldn't create CGI session: " . CGI::Session->err +str; $cookie = $q->cookie(-name => "wweb", -value => $session->id); } exit(0);

    Update Also looking at the CGI::Session documentation again, there is no CGI::Session::Driver::File but only CGI::Session::Driver::file, so maybe your error is in specifying "driver:File" instead of "driver:file".

Re^7: CGI::Session Compilation Issues
by Anonymous Monk on Feb 22, 2010 at 22:58 UTC
    You're supposed to use CGI->... or CGI::Session->errstr()