Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sessions with Cookies & URL rewriting

 
sri rallapalli
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I have read that for the first time the server uses both cookies and URL rewriting, for maintining sessions. URL rewriting can be done only when we give encode URL on the response object, i.e. either in the doGet() or doPost(), If we disable the cookies and not using the encode URL using the response, then what will happen, if i want to maintain session.

Thanks & Regards,
Sri.
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we disable the cookies and not using the encode URL using the response, then what will happen


Container will not able to recognize the sessions and everytime you will try to get the session, it will be new session and isNew() method will always return true.

If you want to track sessions by disabling browser cookies and also not using encodeURL then i think you'll have to device your own mechanism to track the sessions, which can be complex and you should take advantage of what container/J2EE specs provides you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic