This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
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

delete cookie from request ?

 
Miran Cvenkel
Ranch Hand
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a standard func that deletes cookie:



But this is done only when response arives to client.
I need to read request before that and read from it, that cookie does not exist any more.
So I need also to delete cookie from request.

How to do that ?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand your question correctly, Cookies are created in server side and stored in client side. if cookie you have stored in client side expired, then it wont come with request. so no need to delete the cookie from request.
 
Miran Cvenkel
Ranch Hand
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so, I have a 'samplepage 'with


1.that jumps to server
2.there I delete cookie server side , but that i not deleted until whole thing comes back to client,
that is, whole page is loaded, then on the end cookie is deleted, that is how I see it.
3. hence logoff link is stil visible, when I come back to same page,allthough it should not be
4. proof:click browser refresh, and logoff is gone

Edit: upper thing might be wrong, but anyway,
If at the time beeing at server side I 'delete' cookie from response, I would like to read somewhere that it is deleted,
the best thing seems to be to check current request, which still has it.
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make a two phase logout.

From client you call "logout".
Server does what it should and return you to a "/logoutevent.jsp" that clears the cookies and redirect you to the next page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic