473,503 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET: Logging out a session after 30 mins inactivity

7 New Member
Hi all,

i am creating a website and i want to log out the user after 30 mins of inactivity. how do i do this using vb.net.

Also, if the user tries to login and not getting through. after 3 tries i want the system to lock the user out and after 10 mins the user can try again.

can any1 help me?
Aug 7 '08 #1
3 5570
kadghar
1,295 Recognized Expert Top Contributor
Hi all,

i am creating a website and i want to log out the user after 30 mins of inactivity. how do i do this using vb.net.
define a public variable:
Expand|Select|Wrap|Line Numbers
  1. public T as single
each time the user does something
Expand|Select|Wrap|Line Numbers
  1. T = timer
have a Timer or a Do/DoEvents/Loop with

Expand|Select|Wrap|Line Numbers
  1. if T > timer +30 then
  2.    'logout code
  3. end if
Also, if the user tries to login and not getting through. after 3 tries i want the system to lock the user out and after 10 mins the user can try again.

can any1 help me?

in your login code
Expand|Select|Wrap|Line Numbers
  1. dim i as integer
  2. dim s as single
  3. if login = false then
  4.     i = i+1
  5.     if i = 3 then 
  6.         buttonAccept.enabled=false
  7.         t=timer
  8.     end if
  9. end if
and in a timer or a loop, just check that 10 minutes later, the enabled will be true again.

But remember, if the explorer is closed and oppened again, this will be reseted, and your method wont do.

Actually, i dont think i can imagine a good method to solve this very problem. unless you block the user, but this way, any bad guy will be able to block any other users, that'll be rude, wouldnt it?
Aug 7 '08 #2
ashes
7 New Member
Hi,

the code that posted does nothing. do you have any other ideas that may help?
Aug 8 '08 #3
kadghar
1,295 Recognized Expert Top Contributor
Hi,

the code that posted does nothing. do you have any other ideas that may help?
the code gives the main idea. actualy im not sure what Time functions the newer versions of VB have, and of course your controls and variables names can be different.

why dont you check that out?
Aug 8 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
4398
by: Daniel Bengs | last post by:
Hi there... I've got a problem where a normal string variable loses its value after session_start() is called. The funny thing is, that this only happens for some people, and they are using IE6,...
4
39492
by: Ryan Hubbard | last post by:
I would like to limit multiple logins for a user. How and when does the session id expire? Can I set it so after x minutes of inactivity it would expire. How do I check if session id exists? If...
1
9918
by: Alvin Bruney | last post by:
I'd like to prompt the user that their session is about to time out and give them the option to keep the session alive. Any ideas? By the time the session end event fires, the session is already...
1
311
by: Florian Zimmermann | last post by:
Hi everyone, we have configured our IIS and the specific website to use 60 mins for session timeout. Additionally we configured the web.config so that timeout in the sessionState section is set...
7
2899
by: jsale | last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app i have made is running on IIS v6 and consists of a number of pages that allow the user to read information from the...
8
5468
by: bdeviled | last post by:
I am deploying to a web environment that uses load balancing and to insure that sessions persist across servers, the environment uses SQL to manage sessions. The machine.config file determines how...
2
1453
by: whatanut | last post by:
Hi, we have a website built using .Net Framework 2 and Visual Studio 2005 Beta 2. It has a session timeout setting of 20 minutes of inactivity, set in the web.config. But some of our users are...
20
4442
by: Tim Reynolds | last post by:
Team, I am developing a web service. In testing in on my enw PC, I am expecting to see exceptions thrown appear on my browser. Instead I am getting an HTTP 500 Internal Server Error page and I am...
3
246
by: David Gillen | last post by:
Hi. I've 2 requirements - session will end when browser is closed - session will end after 90 minutes inactivity. Now, from the documentation session.cookie-lifetime when set to 0 _should_...
7
20878
by: anithaapr05 | last post by:
Hi, I am creating a session when user successfully login to the site and user gets a form to input some data into database. Assume that user entered data into some fileds and let the browser...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.