Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Create Session in asp .net C# login and registration memberprofile page

Tags:

c#

asp.net

I am new to ASP .net C# i created registration,login and member profile page

after all validations data is stored in database.. and login page also working fine...

i dont know about sessions ..how can i create session and how to make login module more effective using sessions?

thanks in advance

like image 595
user2110292 Avatar asked Dec 12 '25 07:12

user2110292


1 Answers

  1. Session is Per User basis.
  2. You can store the session in SqlServer for to reduce the load on the server

you can create Session like this

Session["yourKey"]=someValue; 

to read this value

if(Session["yourKey"]!=null)
{
  //use the Session values. 
} 

you can use Forms Authentication for Better Approach for login . Forms Authentication

like image 163
Ravi Gadag Avatar answered Dec 13 '25 20:12

Ravi Gadag