SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Localhost Cookies

    Hi guys,

    On localhost I set my cookies with following code:

    PHP Code:
    setcookie('cookiename''secret'time()+26297'/'false); 
    As you can see, Im passing a boolean false as my domain parameter as browsers don't like domains with less than 2 dots and this is the way to bypass it. The only thing wrong with this method is the cookie is not available to localhost subdomains.

    Anyone help would be greatly appreciated.

    Thanks.

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    in your host file *** .loc to localhost then access it via http://localhost.loc/

    Code:
    127.0.0.1    localhost
    127.0.0.1    localhost.loc
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeh I thought that would be the only solution. Thanks.


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
  •