Results 1 to 4 of 4

Thread: php cookies

  1. #1

    Question php cookies

    Okay, I can't set cookies properly.
    If I don't set the "$SERVER_NAME" field, I can only get the cookie from one directory.
    If I DO set it, it doesn't set the cookie..

  2. #2
    Join Date
    Dec 2001
    Do you mean domain name? What version of php do you have? Can you post the code you're trying to use? How long is a peice of string? Oops, sorry about that last question.
    Try this

    PHP Code:

  3. #3
    setcookie("cookie_username", $fusername, time()31535600, "/", "$SERVER_NAME", 0);

    I have the latest version of php on Xitami.
    My point is, that just setting three fields only works in ONE FOLDER, but I need it to work across my whole website!

    What I have up there doesn't do anything. It's as if I wrote:
    Absolutely nothing. So either I have no cookies, or a cookie that only works in one folder, and I need help.

  4. #4
    Join Date
    Dec 2001
    I believe the "/" you have in the path setting is restricting it to the one folder, either remove it altogether , as in"", or don't even use it at all, like the original example I gave.

    Maybe you want to use ".$SERVER_NAME"? If that fails, try adding "" in place just to test it.

    Try this, and change the domain name to your domain.
    PHP Code:

Posting Permissions

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