Click here to Skip to main content
15,922,574 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi my problem is in my application i want to expire a session when user is in idel for 5 minutes and then the page want to redirect to login page and when user login I Want TO Redirected to Session expired page directly please send me the solution
Posted
Comments
Sandeep Mewara 26-Sep-12 3:07am    
and before asking for solution, share with us what you have tried!
Traybabu 26-Sep-12 3:32am    
<sessionstate mode="InProc" cookieless="false" timeout="2">

Try this..

XML
<configuration>
    <system.web>
        <sessionState timeout="60"/>
        </sessionState>
    </system.web>
</configuration>


You can add mode="InProc" cookieless="false" in SessionState.


You can also write the following solution in .cs file
C#
Session.Timeout = 60;


You can set your desired time in place of 60.
 
Share this answer
 
v2
Comments
Traybabu 26-Sep-12 2:59am    
I got It my problem is how to redirect to session expired page after user login again
Sandeep Mewara 26-Sep-12 3:07am    
Question is not how to set session timeout.
Add Global.asax and on session_end event redirect to session exp page

C#
void Session_End(object sender, EventArgs e) 
{
   Response.Redirect("Your page")
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900