Search KB Filter article types
Auto Logout when user idle
Categories: Authentication, State handling
Tags: Developers, Navigation, 2. Intermediate, 3. Advanced, ASP.NET, Pre v6.3, v6.3, v6.4 and Later
Revision: 1
Posted: 05/Jan/2009
Updated: 05/Jan/2009
Status: Publish
Types: Article

The below code will logout the loggedin user when idle for the time specified

Follow the below steps:

1. Declare a variable in web.config file to store the Auto Logout time. (Can use the convenient way to store the time value)

<appSettings>
    <!--  Session Time out value is in minutes and could be changed to any desired value-->
    <add key ="sessionTimeout" value ="10"></add>
</appSettings>

2. In the logon form use the below code

this.Context.HttpContext.Session.Timeout = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["sessionTimeout"]);

This will logout the user when idle for 10 minutes.

About the author

Related Articles

Authentication  
Title Update Author
Tags: Developers, Navigation, 1. Beginner, 2. Intermediate, 3. Advanced, Integration, Navigation, ASP.NET, v6.3, v6.4 and Later
12/Jan/2007    2007/01/12
This video demonstrates how to create a logon form using the form authentication support in Visual WebGui
Tags: Architects, Developers, Windows & Dialogs, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
01/Jan/2009    2009/01/01
This video demonstrates How to create a register form using Visual WebGui
Tags: Architects, Developers, Windows & Dialogs, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
01/Jan/2009    2009/01/01
This video demonstrates How to create a register form using Visual WebGui.
Tags: Architects, Developers, Windows & Dialogs, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
02/Jan/2008    2008/01/02
This is a class to authenticate a user against Microsoft Active directory using the LDAP protocol.
Tags: Architects, Developers, Visual WebGui Pipeline, VB.NET, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
06/Jan/2010    2010/01/06
Tags: Developers, Events, Navigation, 1. Beginner, 2. Intermediate, Navigation, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
03/Jan/2009    2009/01/03
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS