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

I included the line where the constructor is called. The only thing regarding $session above that is the declaration of the variable. If I run the perl script by itself on the same server the perl script works fine, compiling the script using PDK and running it from the same directory doesn't. It gives the error I previously posted. The directory does exist, checked and it works for the perl script. Do you know what dependencies there are for CGI::Session?

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

    CGI::Session likely is installed properly, as your script compiles. As you still didn't provide a self-contained, minimal script that exhibits the behaviour, I can't reproduce your problem. Also, you still keep the value of $perl_directory to yourself, so I can only guess that it is either a relative path, and your webserver does not have the same current directory as you have when you run your script through the shell, or that it is a permission issue and the user your webserver runs as does not have the same permissions as you have on $perl_directory. But then again, you seem bent on blaming this on a CGI::Session compilation issue again and again, so maybe you'll find the solution there.

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

        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".

        You're supposed to use CGI->... or CGI::Session->errstr()