Cookies in PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kurt A. Kaylor

    Cookies in PHP

    Greetings. I am attempting to get this cookie working for a website I
    am running. The code to create the cookie is as follows, when I run it
    on my localhost it works perfectly, however when uploaded it does not
    work. I confirmed the variables ($username, $password) are fine, but
    can't get it to work ! Someone please help me !

    <?php
    setcookie("site data_username", $username, time()+3600, "/",
    ".example.c om", 0);
    setcookie("site data_password", $password, time()+3600, "/",
    ".example.c om", 0);
    ?>
  • Alvaro G Vicario

    #2
    Re: Cookies in PHP

    *** Kurt A. Kaylor wrote/escribió (16 Jul 2004 00:11:31 -0700):[color=blue]
    > Greetings. I am attempting to get this cookie working for a website I
    > am running. The code to create the cookie is as follows, when I run it
    > on my localhost it works perfectly, however when uploaded it does not
    > work.[/color]

    I see you are setting a domain for the cookie. Make sure it isn't a
    security issue in your web browser (some browsers are configured not to
    accept cookies for third-party domains).

    Also, make sure the issue is not in reading the cookie. $_COOKIE variable
    didn't exist in older PHP versions.


    --
    --
    -- Álvaro G. Vicario - Burgos, Spain
    --

    Comment

    Working...