1

I want session management in asp.net application so when ever i am logout my other aspx pages could not open.

Please tell me easy way.

I am new to c# and Asp.net so please ignore my way of asking.

4
  • You should elaborate you question, and show your tried code Commented Sep 26, 2012 at 6:41
  • Here's a starting point codeproject.com/Articles/7182/… but you need to specify what your question exactly is? Commented Sep 26, 2012 at 6:44
  • is that answer helpful to you ? Commented Sep 26, 2012 at 6:48
  • @CuongLe I am new to c# and asp.net that is why i cant ask properly but i think some developers have understood my question... Commented Sep 26, 2012 at 6:57

3 Answers 3

3

When the user logs out. Do following

Session.Clear();
Session.Abandon();

On master page (or all other pages which requires restriction), check

If (Session["sessionname"] == null)
{
Respones.Redirect("MyTimeOutPage.aspx");
}

-Milind

Sign up to request clarification or add additional context in comments.

2 Comments

Very good answer :) Clear cut instructions that i wanted :) Thanks
But it should include Response.Redirect("AdminLoginLMS.aspx"); code after Session.Abandon(); line
2

IMHO The easy way is to work through some tutorials e.g.Building Secure ASP.NET Applications

There's no silver bullet here, you have to understand what the underlying framework is doing.

Comments

0

Try using Authentication and Authorization.

This will be easy and help you in your Project.

You can also do by using SessionManagement. If so, Try these links

ASP.NET Statemanagement Techniques And

Session Management in ASP.NET

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.