subdomain/domain sessions and cookies problem

Discussion in 'PHP' started by rizzy, Feb 14, 2007.

  1. #1
    I am creating a site that has a main page www.widgets.com that people login from. After they login the database has the location the user should be taken to. It connects and does everything correct and takes me to city.widgets.com. From there it says the user does not have access. I checked the session variables and they are empty.

    Any idea how I get the sessions to register correctly from the main domain to the subdomain?

    this is the way i am setting my cookie
    setcookie("lr_user", $username, $duration, "/", .widgets.com);
    PHP:

     
    rizzy, Feb 14, 2007 IP
  2. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Is the fact that you don't have quotes around '.widgets.com' a typo or just an error in the code?

    If it's a typo, please copy and paste the code as opposed to just retyping it.

    If that's how the code is, what happens if you put the quotes around it?
     
    TwistMyArm, Feb 14, 2007 IP
  3. rizzy

    rizzy Peon

    Messages:
    81
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i have it working now
     
    rizzy, Feb 14, 2007 IP