Two Laptop Bag*
The moose likes Servlets and the fly likes Testing for cookie disabled browser - netscape problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Testing for cookie disabled browser - netscape problem" Watch "Testing for cookie disabled browser - netscape problem" New topic
Author

Testing for cookie disabled browser - netscape problem

Sanjay Anand
Ranch Hand

Joined: Apr 03, 2001
Posts: 42
Dear gurus and colleagues,
I have a need to test whether cookies are enabled or not in the browser. Setting a cookie and then getting it did not work because the cookie seems to be visible only 'downstream' from the servlet. So looking through the ever so useful JavaRanch archives I found a solution.
It works for Internet Explorer but not for Netscape (no matter which version).
Any ideas?


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

That's OK, but only if you've already created a session! The best way I know is to snoop out the browser's support in the site's home page so that when they go to log in, it all comes down and you can store it in the session. I do this not only for cookies, but detecting support for Java, JavaScript, etc.


Customer surveys are for companies who didn't pay proper attention to begin with.
Sanjay Anand
Ranch Hand

Joined: Apr 03, 2001
Posts: 42
Please explain how I might do that?
Thanks in advance.
Sanjay
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Testing for cookie disabled browser - netscape problem
 
Similar Threads
browser check alert with cookie
Cookie
Deleting non-persistent Cookie
Cookie question
Cookies