• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 693
  • Last Modified:

Session Timeouts in asp.net/C#

Redirecting User to Login Page After Session Timeouts
using c#
0
chandresh43
Asked:
chandresh43
1 Solution
 
BuginatorCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now