Click here to Skip to main content
16,015,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello sir/madam,

Im doing a web project using vb.net. Im trying to create user idle timeout after 5 minutes with 30 seconds timer for user to continue working in the current page. I don't know how to start and where to start. Where do I create it whether in the login page or in every page. Please give some sample code in vb.net to do the user idle timeout.

Your help is much more appreciated.

Regards : Pam
Posted
Comments
Ankur\m/ 21-Oct-10 1:56am    
Use comments to respond to the user. Adding an answer would never notify the user about your query.

1 solution

You need to authenticate the user in your log-in page. If the user successfully logs in create a session and in every page check the value of the session to verify the user's authenticity. Redirect to log-in page if not authenticated.
You can set a session timeout of 5 minutes in your web.config file. This means, if a user does not request any of your web page, his/her session will timeout and expire. And he/she needs to log-in again to access the pages.

This is just the basic idea on how you will go about it. Take help of search engines (Google, Bing), find relevant tutorials and read them.

I can give you few search keywords - 'asp.net login control', 'session timeout web.config'

pamineshk wrote: with 30 seconds timer for user to continue working in the current page.
I didn't get this part. :confused:
 
Share this answer
 
Comments
pamineshk 21-Oct-10 1:59am    
hi, thank you for the reply. i don get the "authenticate the user in your log-in page". How do i do that? Can you give an example? "with 30 seconds timer for user to continue working in the current page" - this means like if the session going to expired, the system will prompt a msgbox whether to continue the session with 30 seconds timer or no. regrads : pam
Ankur\m/ 21-Oct-10 2:07am    
-authenticate the user in your log-in page:
means, provide a login page where user can login and then can access your web pages. At login you will create a session whose timeout will be set to 5 minutes. Google for 'login control asp.net' and check how to use it. That will clear most of your doubt.

-with 30 seconds timer for user to continue working in the current page
For this, you need to put a javascript timer on your web page. After 4min and 30sec you can show an alert to the user that his session will expire in 30 seconds. Call this function on page load. So this will be fired only when user doesn't send and request and is idle for 4min 30secs.
You also need to consider the scenario when user closed the browser window.

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