我的理解来自
http://msdn.microsoft .com/en-us/library/system.web.configuration.sessionstatesection.regenerateexpiredsessionid.aspx
regenerateExpiredSessionId="false" 的含义是,如果会话 ID 过期,则不会重新生成如果客户端请求具有相同 id 的 url,则使用。
regenerateExpiredSessionId="true" 的含义是,如果会话 id 过期,如果客户端请求具有相同 id 的 url,它将被重新使用(回收)。
但是当我阅读
regenerateExpiredSessionId 未按预期工作
的帖子时,我似乎误解了 regenerateExpiredSessionId “真”的意思。
有人可以解释一下哪个是正确的吗?
My understanding from
http://msdn.microsoft.com/en-us/library/system.web.configuration.sessionstatesection.regenerateexpiredsessionid.aspx
meaning of regenerateExpiredSessionId="false" was that if a session id expired it will NOT be re used if client requests an url with same id.
And mening of regenerateExpiredSessionId="true" was that if a session id expired it will be re-used (recycled) if client request an url with same id.
But when i read post at
regenerateExpiredSessionId not working as expected
it seems that i misunderstood what regenerateExpiredSessionId="true" means.
Can some one explain which is right?
发布评论
评论(2)
默认情况下,无 cookie 会话中使用的会话 ID 值将被回收。也就是说,如果使用已过期的会话 ID 发出请求,则将使用随请求提供的 SessionID 值启动新会话。当多个浏览器使用包含无 cookie SessionID 值的链接时,这可能会导致会话无意中被共享。 (如果链接通过搜索引擎、电子邮件或其他程序传递,则可能会发生这种情况。)您可以通过将应用程序配置为不回收会话标识符来减少共享会话数据的机会。为此,请将 sessionState 配置元素的 regenerateExpiredSessionId 属性设置为 true。当使用过期的会话 ID 发出无 cookie 会话请求时,这会生成新的会话 ID。
参考: http://msdn.microsoft.com/en-us/library/ms178581 .aspx
By default, the session ID values that are used in cookieless sessions are recycled. That is, if a request is made with a session ID that has expired, a new session is started by using the SessionID value that is supplied with the request. This can result in a session unintentionally being shared when a link that contains a cookieless SessionID value is used by multiple browsers. (This can occur if the link is passed through a search engine, through an e-mail message, or through another program.) You can reduce the chance of session data being shared by configuring the application not to recycle session identifiers. To do this, set the regenerateExpiredSessionId attribute of the sessionState configuration element to true. This generates a new session ID when a cookieless session request is made with an expired session ID.
Ref: http://msdn.microsoft.com/en-us/library/ms178581.aspx
我认为,当人们讨论这个属性时,“重新发行”这个词是有问题的。我看到一些帖子将其解释为“生成新的会话 ID 并将其颁发给客户端”,而其他帖子则将其解释为“将过期的会话 ID 分配给新会话并将其颁发给客户端”。我相信 msdn 文档的意思是后一种含义,并且您引用的堆栈溢出帖子错误地将其解释为前一种含义。
I believe that the word "reissue" is problematic when people discuss this attribute. I have seen some posts interpret it to mean "a new session id is generated and issued to the client," and others which interpret it to mean "an expired session id is assigned to a new session and issued to the client." I believe that the msdn documentation means it in the latter sense, and that the stack overflow post you reference incorrectly interpreted it as the former.