Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Error won't occoured,for 10 minute session have to maintain, then it should redirect the page to login form...how can i do this????
Posted
Updated 6-Nov-12 19:39pm
v3

you need to set SeessionTimeOut value in web.config file.
 
Share this answer
 
Comments
sumit kausalye 7-Nov-12 2:09am    
yah sir but i dont have any idea how to write the session in web.config file will u please tell me sir how to maintain the 10 min session if user doesnt single click in 10 min
you can keep session when user login by username and Password by below code
C#
session["userId"]=userId;//i assume that you have a table in database with userId,userName and password Fields and get userIdby connect to database by userName and Password


ok,
now you should go to from login page to default page,for example.
in default page load you must check if user login is valid then show this page to user and otherwise user mus be redirect to login page .this line of code must added to default page load or another page that your going to go there:
C#
if (session["userId"]==null)
  response.redirect("Login.aspx");
 
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