shaolindoman has asked for the wisdom of the Perl Monks concerning the following question:

Hello all. I'm still having trouble using cgi::session. I've been at it about a week and I think I am misunderstanding things in the doc and cookbook. Anyways, my question is, how can I access the session data of a user without the session id being passed directly (as a field in a form or through a query string). I'm asking this because what if a user visits another page and then comes back to mine and I wanted to keep that session alive. How would I access the users data if I'm not passing any sessionID over. And if I were to put this info in a file or something as such, how would I diferentiate between users to make sure I am accessing the proper session. Can anyone please help me understand what I am doing wrong here? I'm totally confused.
  • Comment on Still Having a Struggle with CGI::Session

Replies are listed 'Best First'.
Re: Still Having a Struggle with CGI::Session
by hardburn (Abbot) on Jun 30, 2004 at 16:35 UTC

    A cookie is your only option. HTTP wasn't designed for this.

    ----
    send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.

      Thank you. I just realized I could access the info through a cookie with $sid = $cgi->cookie("CGISESSID") || undef; Hopefully that will work with everything I need. Thanks.
read about data persistence
by chanio (Priest) on Jul 01, 2004 at 02:43 UTC
    Data Persistence talks about ways of preserving the state of sessions. So, when you are identified with one of the stored sessions, you recover the state that you had when you left.

    Databases help a lot to keep this information.

    Don't read too much about this until you try the simplest ways of data persistence, like using cookies or loging in.

    .{\('v')/}
    _`(___)' __________________________