This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Sessions and cookies

 
Ranch Hand
Posts: 1162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The one concept that always eludes me. What is the link between sessions and cookies?
When I close my browser I lose my session id. But the session object sticks around. And when my session Id is gone so is my cookie? what happens to my cookie?
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unless it expired, nothing happened to your cookie. If your session is still good on the server and you go back, the cookie will be used to access that existing session. If the session has timed out on the server and you go back with that cookie, you will get a new session and a cookie with a new session id
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the diff b/w cookie ans session.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by praveen oruganti:
What is the diff b/w cookie ans session.


Rough Summary: A cookie is tiny text file stored in the client browser. A session is an object on the server that can store information. Either one can be utilized to track user activity, preferences and what not. Other than that, there is not much in common.
 
arch rival
Posts: 2813
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The default way of tracking sessions is via a cookie that contains a long number designed to be unique that maps to the session on the server. So when your browser makes a request, it sends the cookie to the server and the server looks up the session associated with that ID and thus it can run "the program" with variables in a state just for your current condition in running the web application.......

Cookies can be used to store other pieces of data. I have the misfortune of using cookies with Perl programming in the early days of the web and it is not something I would like to go back to.
 
praveen oruganti
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Marc Peabody and Marcus Green
 
Police line, do not cross. Well, this tiny ad can go through:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic