Solved

Session Timeouts in asp.net/C#

Posted on 2009-04-09
3
673 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

17 Experts available now in Live!

Get 1:1 Help Now