aspose file tools*
The moose likes JSP and the fly likes Cookies are not deleting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Cookies are not deleting" Watch "Cookies are not deleting" New topic
Author

Cookies are not deleting

Gaurav Chhabras
Ranch Hand

Joined: Sep 21, 2005
Posts: 126
Hi

I have made the cookies thriugh JSP page and stores at the client.
When client again login then those values get prepopulated, but when the user deleting the cookies from his system then also those values getting prepopulated.Could you please tell me the reason that why this is happening and what i should do to make them deleted.

Thanks
Regards
Gaurav
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Are you sure you didn't say your browser to remember the password.
Gaurav Chhabras
Ranch Hand

Joined: Sep 21, 2005
Posts: 126
thanks for response.

Yes i am sure that i haven't tell the browser to remember the password.

Regards
Gaurav
Gaurav Chhabras
Ranch Hand

Joined: Sep 21, 2005
Posts: 126
Hi

There is one another problem that the cookie filled by one user is getting pre populated for the other user.

Tell me that why cookies are not getting deleted when user deletes it from TOOLS -> INTERNET OPTIONS -> Delete Cookies , and why the values filled by one user getting prepopulated for the other user.

Thanks
Rggards
Gaurav
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
It works on machine context. It gets populated with the same values, previously entered by some user, on the same machine no matter who is the user now. It is the likely behaviour.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Gaurav Chhabras:

Tell me that why cookies are not getting deleted when user deletes it from TOOLS -> INTERNET OPTIONS -> Delete Cookies , and why the values filled by one user getting prepopulated for the other user.


Try any other browser?
Gaurav Chhabras
Ranch Hand

Joined: Sep 21, 2005
Posts: 126
Thanks a lot for your response.

But the thing is that i have staged my project on Server , now one user fills his information on his machine now when the other user fills his information on his machine ( that is the other ! ) that means the other machine then he is receving the form prepopulated the fields filled by the other person on other machine.

Thanks
Regards
Gaurav
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Gaurav Chhabras:
But the thing is that i have staged my project on Server , now one user fills his information on his machine now when the other user fills his information on his machine ( that is the other ! ) that means the other machine then he is receving the form prepopulated the fields filled by the other person on other machine.


Wow! interesting. Sounds like server is setting the value, because cookies on one machine doesn't interfere in other.

Could you please show up your code? How you are doing cookies stuff.
Gaurav Chhabras
Ranch Hand

Joined: Sep 21, 2005
Posts: 126
Thanks sir for your response.
I have found my mistake, as i declared all the variables in the Scriptlet.

<%!
String first_name="";
String last_name="";
%>

so the thing was that when init() methord called then these all variable are populated.when the other user came from other machine but for the same page then a new thread will create and other service methord will be called for that but init() only initialized once.
Thats why one user on his machine was fetting the cookie of the other user from other machine because as init() make the cookies on the server.

Thats the fault.

Thanks for your response and great help.
Regards
Gaurav
guarav
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Glad to see its working now.

Tip: Avoid using declarative tags to declare the variables because it goes as instance variable for the generated servlet rather then method variables. If using declarative tags then be careful and make those thread-safe.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cookies are not deleting
 
Similar Threads
Regarding cookie disable
Cannot logon with mozilla 1.1
cookie explanation
Unable to login :(
simple doubt in session management