Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cookies and Session ID  RSS feed

 
Parag Kale
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !
What is the relation between session variables and cookies ?
someone told me that if your browser has Cookies disabled,session variables can no longer be accessed properly.
is this true ? How can I test this ?
All along I thought cookies and Session are entirely diffreent things and either of them could be used independently for maintaining information about the client....
Please help.
Parag
 
Raghavendra Holla
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Session variables and Cookies are entirely different. First is stored in server and can not be disabled by client in any way, later is sent to browser, it is client's discretion to take it or leave it. Testing is upto you. Write a simple servlet with session and a variable. Disable cookie in your browser. Try to read session variable in another simple servlet. That's all your doubt will be clear. Maintaining information always consider to be bad practice, because it is not guaranteed to work. However choice is yours. And also if you want to keep large amount of information, it's not a good idea to store at client side. Isn't it?

Regards
Holla@
 
Parag Kale
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Raghav !! Great answer ! IT registered with me right away !!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!