问题描述:

I have a submain.example.com and example.com . When I set a session in example.com . I can print it out in submain.example.com. But I don't want it. What can I do to disable it?

Thank you.

网友答案:

You can define the valid domains for a cookie. In your case use:

ini_set('session.cookie_domain', $_SERVER['SERVER_NAME']);
相关阅读:
Top