COOKIE (Javascript/PHP)

Discussion in 'Javascript' started by RootShell, Apr 27, 2007.

  1. RootShell

    RootShell Guest

    I have been experiencing a lot of troubles in reading a PHP COOKIE from
    javascript.

    if i write the cookie and read it in javascript in the same PHP file it
    works well, but if i write the cookie for instance in a Javascript(AJAX)
    called PHP file, the Javascript can read it.

    Any ideas why?

    This is a Javascript issue and not PHP, that's why im asking it here.

    Kind regards,
    RootShell
    RootShell, Apr 27, 2007
    #1
    1. Advertising

  2. On Apr 26, 4:14 pm, RootShell <> wrote:
    > I have been experiencing a lot of troubles in reading a PHP COOKIE from
    > javascript.


    There are not PHP or JavaScript cookies. There are just cookies and
    PHP and JavaScript can read and manipulate them.

    > if i write the cookie and read it in javascript in the same PHP file it
    > works well, but if i write the cookie for instance in a Javascript(AJAX)
    > called PHP file, the Javascript can read it.


    That is a mouthful of an explanation. I'm not clear what is the
    problem but I'm guessing that there is something to do with the path
    part of the cookie and that you are not setting that part at all or
    correctly.

    Peter
    Peter Michaux, Apr 27, 2007
    #2
    1. Advertising

  3. RootShell

    RootShell Guest

    Peter Michaux wrote:
    > That is a mouthful of an explanation. I'm not clear what is the
    > problem but I'm guessing that there is something to do with the path
    > part of the cookie and that you are not setting that part at all or
    > correctly.
    >
    > Peter
    >


    You are absolutely right...

    I changed the path part of the cookie and it worked like it was supposed to.

    Thanks for the 'late' feedback anyway.

    Kind regards,
    RootShell
    RootShell, Apr 27, 2007
    #3
    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. =?Utf-8?B?TnVubw==?=

    Convert a PHP cookie to an ASP.NET cookie

    =?Utf-8?B?TnVubw==?=, Jan 31, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    438
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jan 31, 2006
  2. Rajive Narain
    Replies:
    0
    Views:
    1,718
    Rajive Narain
    Sep 18, 2009
  3. Vikram Bhatia
    Replies:
    1
    Views:
    234
    kaeli
    Oct 11, 2003
  4. Phil Powell
    Replies:
    0
    Views:
    152
    Phil Powell
    Feb 16, 2004
  5. Replies:
    2
    Views:
    93
Loading...

Share This Page