Quick Session Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jason Telisch

    Quick Session Question

    I read and reread the PHP manual about sessions, and I have a quick
    question. What causes the session id to change? I tried destroying the
    session and unsetting the session vars, but it maintains the same id.

    Just so you know, I don't need to make the session id change for any
    reason. I'd just like to know what to avoid since I'm going to be storing
    data the user enters with their sessionid and I'd like to make sure that
    they can still access it through their entire visit.
  • Kevin Thorpe

    #2
    Re: Quick Session Question

    Jason Telisch wrote:[color=blue]
    > I read and reread the PHP manual about sessions, and I have a quick
    > question. What causes the session id to change? I tried destroying the
    > session and unsetting the session vars, but it maintains the same id.
    >
    > Just so you know, I don't need to make the session id change for any
    > reason. I'd just like to know what to avoid since I'm going to be storing
    > data the user enters with their sessionid and I'd like to make sure that
    > they can still access it through their entire visit.[/color]

    The session id shouldn't change. It's randomly generated when the user
    enters your website and is then passed back by the browser using cookies
    or as part of the url on each subsequent request. This id is then used
    as the key to the session variables.

    Destroying the session variables simply destroys the contents of the
    session. The id and the empty session will continue to exist.

    Comment

    • Michiel

      #3
      Re: Quick Session Question

      Kevin Thorpe wrote:[color=blue]
      > Jason Telisch wrote:
      >[color=green]
      >> I read and reread the PHP manual about sessions, and I have a quick
      >> question. What causes the session id to change? I tried destroying
      >> the session and unsetting the session vars, but it maintains the same id.
      >>
      >> Just so you know, I don't need to make the session id change for any
      >> reason. I'd just like to know what to avoid since I'm going to be
      >> storing data the user enters with their sessionid and I'd like to make
      >> sure that they can still access it through their entire visit.[/color]
      >
      >
      > The session id shouldn't change. It's randomly generated when the user
      > enters your website and is then passed back by the browser using cookies
      > or as part of the url on each subsequent request. This id is then used
      > as the key to the session variables.
      >
      > Destroying the session variables simply destroys the contents of the
      > session. The id and the empty session will continue to exist.
      >[/color]

      So, when the client deletes the cookie, the session id will be lost. If
      the client continues to visit the site, he will receive a new cookie
      with a new session id.

      Comment

      Working...