PHP5 - Session_set_cookie_params Problem

Discussion in 'PHP' started by tb1234, Nov 27, 2007.

  1. #1
    Hi All,

    I have used session_set_cookie_params to pass my session data across my main domain (non-ssl) and subdomain (ssl). The main problem is that sometime i do get all my session data in to sub domain but sometimes i do not get any of the session value initialized in the main domain.

    Can anybody help me for the problem as i have searched through net but not able to find out the solution yet.

    -----------------------------------------

    one interesting point i found is that the ssl i bough is given to

    w...secure.domainname....

    and i use secure.domainname....

    Is this a problem? also transmission of session works in some pcs and not in some.

    Please help me out if anyone has worked on transmission of session via session_set_cookie_params and ssl combination.

    Thanks in advance.
     
    tb1234, Nov 27, 2007 IP
  2. selling vcc

    selling vcc Peon

    Messages:
    361
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    what are the parameters you set ?
     
    selling vcc, Nov 27, 2007 IP
  3. tb1234

    tb1234 Peon

    Messages:
    49
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    session_set_cookie_params(0, '/', '.mydomain.com');
    session_start();

    This is how i use it. Is it like that for passing the session across multiple sub domain, i need to put session_set_cookie_params(0, '/', '.mydomain.com'); before each session variable i am using? I do not think is like that but http://in.php.net/session_set_cookie_params, first line says "Thus, you need to call session_set_cookie_params() for every request and before session_start() is called."
     
    tb1234, Nov 28, 2007 IP
  4. selling vcc

    selling vcc Peon

    Messages:
    361
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #4
    session_set_cookie_params(0, '/', 'mydomain.com');
    without a dot before the domain
     
    selling vcc, Nov 28, 2007 IP