• Post Reply Bookmark Topic Watch Topic
  • New Topic

Application logout on deleting cookies  RSS feed

 
Aggarwal Arpit
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on one java application and came across with a requirement that, if a end user deletes all browser cookies while application is running and refreshes the page then he should be automatically logout from application.
I have no idea at all how to do it. Please help me out.

Thanks in Advance
 
Tushar Kapila
Ranch Hand
Posts: 35
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
most browsers wont delete cookies until you close the tab or open a new tab.

and most web servers will log you out once the client (browser) does not send cookies. so you will have to tell users to delete cookies, then open a new tab and paste the same URL


I dont think you can do anything else as the cookies are sent by the browser and server wont know if they have been deleted from the browser jar or not.

i guess the browser tab keeps a copy of the cookies even if they are removed from the main storage place -and only new tabs use that.


i just tested this with the coderanch website and it worked. i guess there is a way but not sure how. i deleted cookies on this page using firefox / page info/ security / cookies

and when i refreshed the page it had logged me out!

* It did not work with IE so maybe this is just fixed in firefox. I know it used to not work in FF a few months before
 
Aggarwal Arpit
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tushar,

Are you sure that it will not work in IE?
Is there any reason behind it?
 
Tushar Kapila
Ranch Hand
Posts: 35
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
like i said it did not work in ff too. read my strike out text i gave a guess there:

* some browsers wont delete cookies until you close the tab or open a new tab.

* and most web servers will log you out once the client (browser) does not send cookies. so you will have to tell users to delete cookies, then open a new tab and paste the same URL


* I dont think you can do anything else as the cookies are sent by the browser and server wont know if they have been deleted from the browser jar or not.

* i guess the browser tab keeps a copy of the cookies even if they are removed from the main storage place -and only new tabs use that.

---

so just test your app your self in different browsers and you will know
 
Aggarwal Arpit
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tushar,
you are right.....my application is logged off when I am deleting cookies in ff and chrome but not getting why it's not logging off in IE even I am deleting cookies, browsing history and temporary files.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!