473,569 Members | 2,788 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 5593
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
4404
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, but it does not happen with all versions of IE6. I've tested myself only with Mozilla and IE5, but the problem does not occur for me. I've got a...
4
39497
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 I can do these two things then I can store the session id for a user in a database and everytime he requests an action I can just check if the...
1
9920
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 ended so putting up a javascript box won't make sense since there is no session. I thought of client side which is good in theory but the only...
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 to 60 as well. Regardless of this settings, the session gets abandoned after about 30 mins. Are there any other places that can impact the timeout...
7
2905
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 database into classes, which are used throughout the application. I have made class collections which, upon reading from the DB, create an instance of...
8
5475
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 all applications will use sessions and to insure that all application use this method, the session properties cannot be overriden. Within the...
2
1460
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 timing out sooner than 20 minutes (5 minutes even). Any idea why this may be happening to some but not others and what we can do to fix it? thanks,.
20
4451
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 not seeing my exception details. The web.config file being used has the setting <customErrors mode="Off"/>. This should allow me to see the...
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_ cause the session to end when the browser is closed, although at the moment this doesn't appear to be the case for me. So, question one, can something...
7
20901
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 ideal and doing some other work in his/her system. My requrement is, 2 mins before(after 13 mins) of session timeout(I set session timeout as 15...
0
7697
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7968
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
937
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.