JavaScript cookies (in subdirectories) and PHP file

Discussion in 'Javascript' started by duane, Sep 16, 2003.

  1. duane

    duane Guest

    Dear Experts:

    I have a problem with my JS cookies. I am setting cookies in files
    located in two different directories, e.g. one in ROOT, one in
    ROOT/dir1/dir2. The cookies are then sent to PHP file (server-side)
    which writes their values to a textfile, e.g. OUT.txt.

    The cookies that are in ROOT are working perfectly. No problem. The
    cookies set in ROOT/dir1/dir2, however, "seemed" to be set and read
    correctly, although
    they are never written into OUT.txt in the server. I have used:

    javascript.alert(document.cookie);

    to make sure that all the cookies are set and read properly. They are
    displaying correct cookie values. I have also set the path of cookies
    in ROOT/dir1/dir2 to ROOT directory, e.g. path=/, making sure the
    cookies are accessible from anywhere in the domain.

    I am running out of ideas what may cause the problem and hope you
    could help me.

    Any help would be greatly appreciated.

    Duane
     
    duane, Sep 16, 2003
    #1
    1. Advertising

  2. "duane" <> schreef in bericht
    news:...
    >
    > I have a problem with my JS cookies. I am setting cookies in files
    > located in two different directories, e.g. one in ROOT, one in
    > ROOT/dir1/dir2. The cookies are then sent to PHP file (server-side)
    > which writes their values to a textfile, e.g. OUT.txt.
    >


    How do you write the cookies to the text file?

    > The cookies that are in ROOT are working perfectly. No problem. The
    > cookies set in ROOT/dir1/dir2, however, "seemed" to be set and read
    > correctly, although
    > they are never written into OUT.txt in the server. I have used:
    >
    > javascript.alert(document.cookie);
    >


    Be aware that when testing cookies this way, they will be available before
    the cookie header is send. This is because in JavaScript, 'document' is an
    object and 'cookie' a property of this object.

    In PHP, the cookie is available not sooner then after a reload of the page.


    JW
     
    Janwillem Borleffs, Sep 18, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. _Who
    Replies:
    7
    Views:
    2,752
  2. Rajive Narain
    Replies:
    0
    Views:
    2,014
    Rajive Narain
    Sep 18, 2009
  3. Jaap Zuidersma

    subdirectories in javascript

    Jaap Zuidersma, May 15, 2005, in forum: Javascript
    Replies:
    9
    Views:
    132
    Randy Webb
    May 17, 2005
  4. Replies:
    3
    Views:
    232
    frothpoker
    Sep 4, 2006
  5. __
    Replies:
    1
    Views:
    128
    Gregor Kofler
    Oct 2, 2007
Loading...

Share This Page