File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Check Cookies enabled via JavaScript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Check Cookies enabled via JavaScript" Watch "Check Cookies enabled via JavaScript" New topic
Author

Check Cookies enabled via JavaScript

Carpe Diem
Greenhorn

Joined: Sep 24, 2004
Posts: 2
Hi,
I'm developing web pages for the browser netscape 4.78.
Now I try to check in my page whether the netscape browser showing the pages has c ookies enabled.
In netscape version 5 and 6 it works in JavaScript via navigator.c ookieEnabled. Is there an equivalent function for netscape version 4.78?

Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I think the easiest way of testiung crossbrowser wise is:



Eric
Carpe Diem
Greenhorn

Joined: Sep 24, 2004
Posts: 2
Thanks Eric,

it works that way.
Just one remark. To compare by equality that test is stored in the cookie failed because additionaly the jsessionid was also stored in the cookie. Bur checking for test as substring of the cookie contents was successfully.

Thanks again and bye
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You cpould just test to see if the length of the cookie is greater then 0 too.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Check Cookies enabled via JavaScript