SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Cookiez

  1. #1
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to create a cookie that is readable on several different domains.

    Let's say I have:
    http://www.bob.com
    http://www.joe.com
    http://www.shut_up_hippy.com

    They're in separate directories as well:
    /home/httpd/www/bob/www
    /home/httpd/www/joe/www
    /home/httpd/www/shut_up_hippy/www/dick_nixon

    I want to create a cookie that is readable by all of those domains, or in the least create 3 cookies at once.

    I have a silly solution where, upon creation of the cookie in one domain I forward them off to the next to create the cookie in that domain, etc. so that I end up creating 3 cookies by bouncing the user from site-to-site. This seems like a time consuming and stupid way of doing it. Is there an easier / better way?

  2. #2
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTTP's protocol does not allow one domain to set cookies for another.. what you're doing now is probably the only way
    cogito, ergo sum

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Matt, your idea is best one I can think of. Microsoft is using the same for "passport". So currently there is no other way.
    Great Dane
    Gokhan ARLI

  4. #4
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok,

    I just wanted to make sure I wasn't overlooking something small to warrant a (in my mind) workaround.

    Thanks!

  5. #5
    SitePoint Enthusiast einstien_ii's Avatar
    Join Date
    Jan 2001
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well Matt, if you cannot have all the domains in one cookie, then you can have three different cookies and a script to read them and verify them.

    Lets say you verify the no: of cookies present and then execute whatever you want!

    Well, its only a logic and I am not sure if it will work practically, anyway, let me know!

    Krishna Narayanan
    einstien_ii@zeenext.com
    http://www.talofians.net



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
  •