开发者

How can i maintain session with subdomain and https

I have a problem related to subdomain and https request.

I am trying to route from http to https where my http address is subdomain.domain.com and https address is domain.com/subdomain. 开发者_JAVA技巧But the problem is when i switched from http to https i loose my session variables.

How can i persist my session variables in both http and https requests.

Thank you.


The session is probably tracked by a cookie.

Cookies have a domain associated with them, in this case this would be "subdomain.domain.com". For a different domain, even if it is the parent domain, the cookie will not be provided by the web browser.

I think there are ways to make a cookie valid for all subdomains under a given domain, but you have to look into the documentation of the software you are using for that.

For any more information, we really need more detail about what software you are using to keep this session. Standard PHP sessions? Or something else?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜