开发者

ASP.NET MVC : Update member's LastSeen

I want to know rough time when a member was last seen in the system.

I remember login for 2 weeks. So actual "ValidateUser" on MembershipProvider can be executed quite infrequently.

For now I just call DB.UpdateMembershipLastSeenTime() every time from RequireAuthorizationAttribute, i.e. on every authentication-requiring action.

Any recommendations/critique?

Framework: ASP.NET MVC 2.0 RC, IIS 7.0 (integrate开发者_Go百科d mode), custom membership provider with storage in MS SQL 2008.


If you only care about rough estimates, you could do it in Application_AuthenticateRequest, Session_Start or Session_End in your Global.asax.

As long as they are already authenticated, this way it happens once each time they come to your website. This won't work of course if you've got a very lengthy session timeout.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜