Loading ...
Sorry, an error occurred while loading the content.

Session variables - help please

Expand Messages
  • zen_e_boy
    Can anyone point me to a practical example of how to use and implement session variables? Some may think that session variables are not exactly perl-beginner.
    Message 1 of 2 , Feb 2, 2008
    • 0 Attachment
      Can anyone point me to a practical example of how to use and implement
      session variables?

      Some may think that session variables are not exactly perl-beginner.
      But I want to implement them for maintaining state for user logins on
      a club website.

      So far (using CGI::Session) I have managed to:
      Create a new session and get a session ID and plant it as a cookie.

      I can retrieve the value from cookie, but after that I get stuck. How
      do I know if the session I retrieve is existing or new?

      When I pass the value I get into CGI::Session like this:
      $session = new CGI::Session("driver:File", $cvalue,
      {Directory=>$sessiondir});

      Where $cvalue is the session ID I got from the cookie and $sessiondir
      is the path to the session files created (and they do get created).
      I get CGI::Session::File=HASH(0x81fd180) or similar for $session.
      Every time its different.

      This is where Im stuck. How can I tell if the session is existing or new?

      Go easy. Im not a programmer, this is a hobby, of sorts. I dont
      understand a lot of the tekky terms used.
    • zen_e_boy
      No need to respond. In the end I wrote my own session handler, it took about 3 hours.
      Message 2 of 2 , Feb 5, 2008
      • 0 Attachment
        No need to respond.
        In the end I wrote my own session handler, it took about 3 hours.
      Your message has been successfully submitted and would be delivered to recipients shortly.