1

I am using Asp.net 4.5, Ef 6, Identity 2
I have implemented the session in my app by the following code in

web.config

<sessionState cookieless="false" mode="SQLServer" sqlConnectionString="Data Source=192.168.0.1\SQLEXPRESS;User Id=sa;Password=123456;" timeout="1"></sessionState>

In Global.asax file

public void Session_end()
{
   Redirect("LogOut");
}

But, when session expire the app is not logging out. it showing error at the session variable

variable is not set an instance of oject

I want to logout the user when the session expires.Thanks in advance

anand
  • 1,559
  • 5
  • 21
  • 45
  • Possible duplicate of [How to log out a user when a session times out or ends](http://stackoverflow.com/questions/4413886/how-to-log-out-a-user-when-a-session-times-out-or-ends) – NightOwl888 Mar 09 '16 at 07:37
  • 2
    Session has *nothing* to do with logging out a user. You need your authentication mechanism to timeout, not session. – Erik Philips Mar 09 '16 at 07:38
  • @Erik Philips can be explain with an exmple – anand Mar 10 '16 at 05:58
  • 1
    Possible duplicate of [Session timeout does not work ( is set in web.config )](http://stackoverflow.com/questions/35862907/session-timeout-does-not-work-is-set-in-web-config) – Erik Philips Mar 10 '16 at 06:07

0 Answers0