Results 1 to 3 of 3

Thread: setcookie()

  1. #1
    Join Date
    Sep 2002
    Location
    Top Secret
    Posts
    11,686

    setcookie()

    Having a rather difficult time with this one, maybe someone could help me out a bit here.
    The project:
    Setting torrentbits up to use phpnuke users. While phpnuke isn't the best out there for this, it's what I started the project with a few years back, and it's secure enough for me
    The dilemna:
    The nuke install is called using domain.com
    The tracker install should be called using tracker.domain.com
    I've written the import script (really not that complicated), and adjusted phpnuke's login stuff to set the tracker cookies, but they're not taking unless they're set directly, as such:
    Code:
    setcookie("uid", $row["id"], time()+2592000, "", "");
    setcookie("pass", $row["passhash"], time()+2592000, "", "");
    Obviously what that does is set the cookie up as www.domain.com
    I've tried
    Code:
    setcookie("uid", $row["id"], time()+2592000, "", "tracker.domain.com");
    setcookie("pass", $row["passhash"], time()+2592000, "", "tracker.domain.com");
    with no luck. I've even tried:
    Code:
    setcookie("uid", $row["id"], time()+2592000, "/tracker/", "");
    setcookie("pass", $row["passhash"], time()+2592000, "/tracker/", "");
    Again, with no luck
    Is it even POSSIBLE to set the cookie using setcookie() from www.domain.com to be tracker.domain.com? And if so , how? I've read numerous places that most browsers will stop this (thinking it's forgery of some kind), but is there a way around that somehow?
    WHMCS Guru - WHMCS addons, management, support and more.
    WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to WHMCS !!
    Always looking for Linux, WHMCS, Support Desk work. PM for details

  2. #2
    Join Date
    Nov 2002
    Location
    Finland
    Posts
    96
    Hi,


    try to change the cookie domain to ".domain.com"

    example:
    Code:
    setcookie("pass", $row["passhash"], time()+2592000, "/", ".domain.com");

    That should make the cookie available on all subdomains...


    - Tero

  3. #3
    Join Date
    Sep 2002
    Location
    Top Secret
    Posts
    11,686
    hrrrm
    Thought I tried that, but I guess I didn't successfully try it. Thanks, for whatever reason it didn't work the first time I tried it but it did this time.
    WHMCS Guru - WHMCS addons, management, support and more.
    WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to WHMCS !!
    Always looking for Linux, WHMCS, Support Desk work. PM for details

Posting Permissions

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