Link to home
Start Free TrialLog in
Avatar of mmalik15
mmalik15

asked on

How to redirect user to a login page after session time out

Hi
I am using forms authentication for my application. I manage to create login page and do the session time out but even after the session is time out when  user clicks on  link the user is not redirected to the login page.  My web.config has the following code for authentication,authorization and session time out

<authentication mode="Forms">
<forms path="/" loginUrl="Login.aspx"/>
</authentication>  

<authorization>
<deny users="?" />
</authorization>

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data
                        source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="1" />

and my code on the Login page button click is

Dim ticket As New FormsAuthenticationTicket(m_username, False, 1)
FormsAuthentication.RedirectFromLoginPage(m_username, False)

Any ideas how can we redirect user to a login page
Thanks
Avatar of OMC2000
OMC2000
Flag of Russian Federation image

ASKER CERTIFIED SOLUTION
Avatar of bugs021997
bugs021997
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial