Maintaining Session Variables across Subdomains

前端 未结 2 1858
花落未央
花落未央 2021-02-06 14:24

I have been trying to maintain session vars between two subdomains and found it impossible. I ended up creating 2 minimal PHP web pages as a test bed, one I call \'test 1\' just

2条回答
  •  被撕碎了的回忆
    2021-02-06 15:26

    I have it working, setting a session name and session cookie parameters:

    $some_name = session_name("some_name");
    session_set_cookie_params(0, '/', '.some_domain.com');
    session_start();
    

提交回复
热议问题