SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Cookies

  1. #1
    SitePoint Member
    Join Date
    Dec 2001
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cookies

    I want to test my PHP scripts on my computer, but I have no domain name yet and I do not know what to write in the "domain" part of the script for setting a cookie:

    setcookie("referrer", "31", time()+3600, "/", "?????????", 0);

    I would appreciate your suggestions. Thanks.

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2001
    Location
    Nanaimo, BC, Canada
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a wild guess.. but you might want to try localhost

  3. #3
    SitePoint Member
    Join Date
    Feb 2002
    Location
    Portugal
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    why do you need that?

    Hello,

    Most of the times, the setcookie function is used with the first 3 arguments only (name of variable, value and expiration time). The other variables are normally not necessary. Regarding the domain part, as you ask, if you leave it not filled you will mean that only your server (i.e. the server that sent the cookie in the first place) will have access to the cookie. This is the default and the result of the cookies specifications.

    So my advice is just leave it blank.

    Thanks,

    Rui Alves
    [php-db.com]


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
  •