为什么global.asax中的Session_Start事件会在我的网站上的每个页面请求上触发. [英] Why Session_Start event in global.asax fires on each page request on my website.

查看:138
本文介绍了为什么global.asax中的Session_Start事件会在我的网站上的每个页面请求上触发.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么会这样?global.asax中的Session_Start事件
在我的网站上的每个页面请求上触发.


第一次运行良好,经过一段时间的global.asax中的Session_Start事件
在每个页面请求上触发

为什么会发生这种情况?


请帮帮我


如果您不明白我的问题,请告诉我

谢谢,
Chaitanya

Why would this happen?Session_Start event in global.asax
fires on each page request on my website.


First time it is working fine,after some time Session_Start event in global.asax
fires on each page request

Why would this happen?


Please help me


Please let me know if you did not understand my question

Thanks,
Chaitanya

推荐答案

#Session_Start:当新用户访问应用程序网站时触发.
请通过这些链接
http://www.techrepublic.com/article/working-with-the- aspnet-globalasax-file/5771721 [ ^ ]
http://msdn.microsoft.com/en-us/library/ms178473.aspx [ ^ ]
# Session_Start: Fired when a new user visits the application Website.

Please go through these links
http://www.techrepublic.com/article/working-with-the-aspnet-globalasax-file/5771721[^]
http://msdn.microsoft.com/en-us/library/ms178473.aspx[^]


检查.

http://stackoverflow.com/questions/4451786/why-does-session-start-in-global-asax-cs-cause-performance-问题 [
Check this.

http://stackoverflow.com/questions/4451786/why-does-session-start-in-global-asax-cs-cause-performance-problems[^]


会话开始事件为仅在用户的新会话开始时才触发.一旦为用户触发了"Session_Start",则如果用户对应用程序内的任何资源提出后续请求,则根本不会触发该事件.仅当用户的会话期满,然后用户尝试再次访问应用程序中的任何资源时,才会触发事件.
当用户首次访问您的站点/应用程序或会话开始时,您想执行某项操作时可以使用此事件.如果您不使用可以在web.config中禁用的会话,则不会触发此事件.

请参考
[
Session start event is fired only when a new session for a user starts. Once "Session_Start" for a user is fired then if the user makes subsequent request to any resource within the application this event is not at all triggered. The event is triggered only when the user’s session expires and then the user tries to access any resource in the application again.
This event can be used when you want to do something when the user visits you site/application for the first time or when his session starts. This event doesn’t get triggered if you are not using sessions which can be disabled in the web.config.

Refer this[^] for more information.


--Amit


这篇关于为什么global.asax中的Session_Start事件会在我的网站上的每个页面请求上触发.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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