开发者

Check once per user session - asp.net

开发者 https://www.devze.com 2023-03-05 07:59 出处:网络
I would like to make a call to the underlying backend just one time when user first initiates a user session. While the session is up, the same call shall never be made again. Do I just create a singl

I would like to make a call to the underlying backend just one time when user first initiates a user session. While the session is up, the same call shall never be made again. Do I just create a singleton tied to the particular session or is there 开发者_JAVA百科a better way to do this?


You can place the method call in the global.asax Session_Start event.

List of available events is listed here.


You can always use the Begin_Session Session_Start method in the global.asax. This will fire only once and only at the beginning of the session. It will fire before any authentication occurs, though.

Edit: Begin_Session? Sorry. Code bleed in my brain. I've corrected the actual function name above. The bleed was for a proprietary project I had active in my noggin when I was reading the question.

0

精彩评论

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

关注公众号