SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: ~ramus

Hybrid View

  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    ~ramus

    Code:
    setcookie ("TestCookie", "", time() - 3600, "/~rasmus/", ".example.com", 1);
    The code above is from an example2 in the manual
    What does "/~rasmus/" mean?

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, as you can see in the manual the fourth parameter is path:
    The path on the server in which the cookie will be available on. If set to '/', the cookie will be available within the entire domain. If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. The default value is the current directory that the cookie is being set in.

  3. #3
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you, Alan.
    Code:
    setcookie ("TestCookie", "", time() - 3600, "/~rasmus/", ".example.com", 1);
    Since value is in the 2nd parameter like the following, I think, the last one "1" is not a value.
    Code:
    setcookie ("TestCookie", "$value", time() - 3600, "/~rasmus/", ".example.com", 1);
    What is the meaning of the last one "1"?

  4. #4
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The sixth parameter "1" (bool true) indicates that the cookie should only be transmitted over a secure HTTPS connection from the client.


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
  •