Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: What is Difference between Session and Cookie

by Anonymous Monk
on May 09, 2011 at 20:10 UTC ( #903826=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://903826]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2021-09-25 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?