3

i've a problem with session on my multi-domain website.

In fact, i've :

  • www.website.com

and

  • my-account.website.com

In the php.ini, i've set : session.cookie_domain = ".website.com"

I check if it correctly change with phpinfo(); and it's ok, i've well the same value for both website (domaine and sub-domain) :

  • the same session.cookie_domain, session.save_path, session.cookie_path.

  • session.cookie_lifetime = 0 and session.cookie_secure is off

Well, now, when i try some test :

  • Define a session_name on www.website.com, start the session, define un session value like $_SESSION["test"] = "myvalue"; and i display the session_id.
  • Go to my-account.website.com and open the session with the same session name, i check the session id and i found the same id with www.website.com, but i have lost the session value that i defined. S_SESSION["test"] is lost.

Conclusion, the session id is kept, but sessions values are lost.

Any idea ? I have check to change with session_set_cookie_params(0, '/', '.website.com'); on each website. And also try to use the htaccess php_value session.cookie_domain ".website.com"

HELP, THAT MADE ME CRAZY.

4

1 回答 1

0

搜索不成功后,我在我的 Debian 上重新安装了 apache2。问题已解决,会话值已成功共享。

我认为我的 apache2 在 2 个月前被插件安装损坏了。

于 2012-11-20T14:56:39.617 回答