Solved

Session Timeouts in asp.net/C#

Posted on 2009-04-09
3
672 Views
Last Modified: 2012-05-06
Redirecting User to Login Page After Session Timeouts
using c#
0
Comment
Question by:chandresh43
3 Comments
 
LVL 5

Accepted Solution

by:
Buginator earned 250 total points
ID: 24109104
Let's say the user has logged in and a session called Username exists.

The following code redirects the user to the loginpage called Login.aspx after the session timeouts:
if (Session["Username"] == null)

{

    Response.Redirect("Login.aspx");

}

else

{

    //You code for logged in users here

}

Open in new window

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
optimize  c# code 7 49
Code works but how can I download the file? 20 47
C# Error - Add Failed 12 52
Different Delete Messages 7 19
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now