1.11M Members

Login/Logout Session

 
0
 

Guys i am niew for the .net site development. I have a small question. I have my personal login page created in jquery. I am not using login form of ASP.net. Now the question is how to create a session for the user. I have 4 web pages (Below are the list).

  1. Index
  2. About
  3. Health & Fitness Tracker (This site is for the user. User can get his health personal health tracker. And even tracks it means user can latter on check his/her history)
  4. News and article. (News user can check the different news and article. Even User can check his history page which ever news and article he looked at)

Now how to create session for all 4 webpages.

How to define globally so that i do not have to define it again and again.

Even define globally Logout session too. Please help me.

 
0
 

You can store name/value pairs in session state very easily. Once you have logged in a user you can set the ssions variable like this:
Session["loggedIn"] = "true";

You can then later alter the session variable or check it for logged in status. In your global.asx file you can specify any session variables you are going to use by setting them up in the session_start section.

I hope that helps.

 
0
 

I understood that but how to create a session is the main question.

 
0
 

When you press login button after entering data.. just mention session["loginin"] = "true"; in button_Click method.

 
0
 

thanks for telling about login or logout session, what is highest session time we can cutomised on .net sites?

 
0
 

I'm not sure what the actual limit is (although I think I once read it was a year) but you wouldn't want to have it more than an hour or two surely. If you set it to a very long time you're going to be wasting a lot of server memory with session variables that aren't even being used anymore.

Question Answered as of 2 Years Ago by hericles, faizan11 and Syed-yunus
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article