SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its my turn to ask a question this time

    can somebody give me some code which does the following (really simple task, i just havent bothered to deal with client side code)

    if user has cookies disabled, redirect to specific url...

    thats all..

    i was looking at some code, i thought if(document.cookie == "") would work, but maybe i'm wrong

    thanks
    Last edited by Vinay; Feb 8, 2001 at 00:41.
    cogito, ergo sum

  2. #2
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Vinay,

    In IE, you can see if cookies are enabled with this:

    navigator.cookieEnabled

    but in NN, as far as I know, there is no way to check to see if cookies are enabled. What document.cookies would do is see if a cookie is there. I guess you could create a cookie, and then try to access it, and if you can't, then you know cookies aren't enabled.

    aDog

  3. #3
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hehe, i solved my problem..

    i decided to go the "keep as much as possible server side" technique

    i rewrote the code chunk to do the "Testing of a valid cookie" .. which isnt that easy in my case, since i'm dealing with multiple webservers for the authentication bit which is what i require the cookies for in the first place
    cogito, ergo sum


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •