在IE上重定向了domian的页面之间的会话对象丢失 [英] Session Object Lost between pages with redirected domian on IE

查看:91
本文介绍了在IE上重定向了domian的页面之间的会话对象丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个域.像这样:

1) www.mydomain.com
2) www.mydomain.virtual.com

临时地,我必须将域1重定向到域2,因此当有人使用www.mydomain.com时,y会将其重定向到www.mydomain.virtual.com.

Temporarly, i must redirect Domain 1 to Domain 2, so when someone use www.mydomain.com y redirected him to www.mydomain.virtual.com.

我面临的问题是(仅在Internet Explorer上)会话对象现在丢失了我的Web子页面之间.我在default.aspx上创建一个会话,当我使用response重定向时.重定向到main.aspx,该对象没有任何价值.有谁知道为什么吗?谢谢!

The problem I'm facing is that (only on internet Explorer) session object is now losted between my sub-pages inside my web. I créate a session on default.aspx, and when i redirect with response.Redirect to let's say main.aspx, the object has no value. Does anyone have any idea why? Thanks!

推荐答案

会话存储在服务器上,但是客户端需要跟踪sessionid.通常,会话cookie用于存储sessionid.

Sessions are stored on the server, but the client needs to keep track of the sessionid. Usually a session cookie is used to store the sessionid.

导致此行为的原因是无法解析sessionid.可能是因为域名不同,浏览器将其解释为第三方Cookie,该Cookie可能被浏览器阻止(并且有可能被阻止).

What is causing this behaviour is that the sessionid cannot be resolved. Probably because the domain name is different and the browser interprets this as a third-party cookie, which can be (and probably is) blocked by the browser.

由于无法解析sessionid,因此无法访问服务器上的所有会话信息.链接已断开.

Since the sessionid cannot be resolved, all session info on the server is inaccessible. The link is broken.

是否可以将整个网站复制到临时位置,并将对原始网站的所有呼叫重定向到该临时位置上的等效页面?

Is it an option to copy the entire website to the temporary location and redirect all calls made to the original website to the equivalent page on the temporary location?

否则,您可以使用无cookie会话来解决问题:

Otherwise you can solve your issue by using cookieless sessions:

https://msdn.microsoft.com/zh-CN/library/system.web.configuration.sessionstatesection.cookieless%28v=vs.110%29.aspx

有关cookie的更多信息:

For more information concerning cookies:

http://erik.io/blog/2014/03/04/definitive-guide-to-cookie-domains/

这篇关于在IE上重定向了domian的页面之间的会话对象丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆