session_set_cookie_params problem with ssl

Discussion in 'PHP' started by dizyn, Sep 28, 2010.

  1. #1
    Hi All,

    I am using session_set_cookie_params to pass my session data across my main domain and sub domains. my main domain has (non ssl pages, as well as ssl pages but my sub domains they have only non ssl pages)


    Session works pretty fine on main domain but when i go to sub domains it do not work there...

    Can anyone help me to fix this issue? It was working pretty fine before SSL.

    Here is my code:
    session_set_cookie_params(3600,'/','.domain.com');

    Thanks in advance.
     
    dizyn, Sep 28, 2010 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    You need to set the domain in php.ini:

    session.cookie_domain = .mydomain.com

    Otherwise you can do it at the top of the script:

    ini_set("session.cookie_domain", ".mydomain.com");
     
    jestep, Sep 28, 2010 IP