in reply to Re: What is Difference between Session and Cookie
in thread What is Difference between Session and Cookie

The main difference between cookies and sessions is that cookies are stored in the user's browser, and sessions are not. A cookie can keep information in the user's browser until deleted. Sessions work instead like a token allowing access and passing information while the user has their browser open. The problem with sessions is that when you close your browser you also lose the session. I have read the very good post on cookies and sessions with suitable php code.You can see that in http://cs-pages.blogspot.com/2011/05/difference-between-cookies-and-sessions.html
  • Comment on Re^2: What is Difference between Session and Cookie

Replies are listed 'Best First'.
Re^3: What is Difference between Session and Cookie
by Anonymous Monk on May 10, 2011 at 11:08 UTC
    The problem with sessions is that when you close your browser you also lose the session.

    That is not a property of sessions.

    If closing your browser deletes cookies, and deletes the session cookie, then there is nothing associating your browser and the session, and the session can be considered lost.

    If however, a session is also associated with an account, breaking the association with the browser (deleting cookies) doesn't break the association with the account -- you can resume the session after you log-in again