Click here to Skip to main content
15,893,790 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi ,, i have made a class for login operations in my application ...
i want to use session inside of my class ,, for saving user id
how can i do this thing
?
Posted

1 solution

You can set your userId variable in Session as below.
C#
Session["FirstName"] = userId;


Have a look ate below link for more details on Asp.Net Session.
http://msdn.microsoft.com/en-us/library/ms178581.aspx

Edit - To access Sessions in any class have a look at below link.
http://stackoverflow.com/questions/621549/how-to-access-session-variables-from-any-class-in-asp-net
 
Share this answer
 
v2

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