in reply to CGI::Application CGI::Session problem

It's because you create a new session upon each invocation and then set the cookie to it's id. perldoc CGI::Session

update: You might wanna take a look at generic-cgi-app, it's based on one of merlyn's articles (just read the source), and demonstrates how to be user friendly when giving away cookies ;)

update: ah, I see, cheers

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

  • Comment on Re: CGI::Application CGI::Session problem

Replies are listed 'Best First'.
Re: Re: CGI::Application CGI::Session problem
by fireartist (Chaplain) on Jun 14, 2003 at 18:14 UTC
    I've figured it out!
    It wasn't creating the session files.
    My CGI::Session data directory needed permissions 777 rather than 766.
    My new construct works because I'm passing my CGI object as the 2nd argument, so CGI::Session can find the session id from the cookie itself.
    Also, my cookie name should have been 'CGISESSID' so that CGI::Session could find the value.

    cheers though PodMaster
      A security note (not that I'm an expert or anything, but still):

      777 is much too permissive. You might want to change the owner of the directory to the server's user name (the name the server runs with) or change the group of that dir to some group that the server is a member of, and give it a 77x(something less than 7).