File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cookies are not deleting

 
Gaurav Chhabras
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure you didn't say your browser to remember the password.
 
Gaurav Chhabras
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for response.

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

Regards
Gaurav
 
Gaurav Chhabras
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic