forum

Home / DeveloperSection / Forums / Session object in mvc

Session object in mvc

Anonymous User193911-Oct-2014
i want to save some user settings on Session object. And get it from Session if i will need it. for this reason i want to create Base Controller which another controllers are inherited from this BaseController. and want to check the session for null. if session is null then redirect to logon page. i have added.

<authenticationmode="Forms">
      <formsloginUrl="~/Membership/LogOn"timeout="1"defaultUrl="~/Membership/LogOn"/>
    </authentication>

o webconfig file. after minute it redirects to LogOn page. But i know that my session wil end after 10 minutes. how i can make so that Session objects and httpContext.Request.IsAuthenticated die in same time?

and please tell me in which Event i must check session in BaseController. in OnActionExecuting?


Updated on 11-Oct-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By