Click here to Skip to main content
15,912,475 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
procedure to create session in asp.net
Posted
Comments
Smithers-Jones 4-May-11 7:46am    
"procedure to create session in asp.net" - Courtesy to phrase a full sentence.

Anoying, isn't it?
How can you expect others to sit down and write a helpful answer, if you don't even bother to properly phrase your problem but just throw some bits?
evigneesh 4-May-11 7:51am    
Next i write full code in question section sorry if i do any thing wrong

if Login is Successfull
then
// Create Session 
Session.Add("UserId",Value);

//on LogOut

 //Clear Your Session
 Session.Clear();
 Session.Abondon();
 
Share this answer
 
Comments
evigneesh 4-May-11 7:53am    
thanks
You don't have to manually create a session. When the user logs in, just do something like this:

C#
Session["UserName"] = username;


It ain't rocket surgery...
 
Share this answer
 
Session["username"]=yourcontorl value1;
session["password"]=....


in page unload event
session.abandon();
 
Share this answer
 
Comments
evigneesh 6-May-11 3:04am    
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900