Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

client-side javascript and cookies

Options
  • 12-08-2004 12:26pm
    #1
    Registered Users Posts: 1,278 ✭✭✭


    hello,

    i am currently porting a client-side javascript application which needs to be run from the client's machine rather than from a server (ie. the client's browser opens the application as a file:// location). i would like to be able to use cookies to store information from the client but am not sure whether this can be done when opening a site from hard-drive as opposed to opening from a web server.

    i have written a very simple cookie test html with javascript file, which works fine under Firefox0.93, but is not displaying the cookie value in IE5.0 or Mozilla1.7b (when run from client's machine). the cookie test file (and its source code) can be viewed online (it is working as its on a web server as opposed to file:// location) at:
    http://galwaysky.port5.com/cookie/myCookieTest.htm

    if anyone can enlighten me on this whole area of working with cookies from a browser opening an app on client's machine rather than server i would appreciate it.

    grma,
    jAH


Comments

  • Closed Accounts Posts: 304 ✭✭Zaltais


    No idea if it should work, but after a bit of testing:

    Firefox 0.91: Yes
    Opera 6.0: No
    Netscape 4.7: No
    Netscape 7.1: Yes
    Internet Explorer (4.0, 5.01, 5.5, & 6.0): No


  • Registered Users Posts: 1,278 ✭✭✭jArgHA


    cheers Zaltais, i don't have Netscape or Opera installed so couldn't test in that. if found a little fix which seems to improve things:

    i changed the <script language="Javascript1.5"> tag to <script language="Javascript"> and it now seems to work offline in IE5.0, but is still not working under default settings in Mozilla 1.7b. if, however, i change the cookie settings in Mozilla under edit->prefs->privacy&security->cookies from "Allow cookies based on privacy settings" (medium), to "Allow all cookies", it DOES work offline...

    the newer test file has been uploaded to http://galwaysky.port5.com/cookie/myCookieTest.htm

    jAH


  • Closed Accounts Posts: 304 ✭✭Zaltais


    Now works for me offline in all the afforementioned browsers...

    Don't have Moz here though I'm afraid...


Advertisement