I'm going to ask a user to login first, then when I'm going to save information I'm going to have to save the information and associate it with the logged in user.
How should I handle this with session?
I'm going to ask a user to login first, then when I'm going to save information I'm going to have to save the information and associate it with the logged in user.
How should I handle this with session?
Why not use the ASP.NET Membership toolkit that's already integrated into ASP.NET? (well, integrated sorta)
You could just use Response.Cookies http://msdn.microsoft.com/en-us/library/78c837bd.aspx
By default, Session uses memory storage on the server, and identifies the data using an identifier cookie.
You could optionally store everything in cookies, which is particularly useful if you have more than one web server. However, you shouldn't store sensitive data there.
Web.Config for InProc session:
<configuration>
<sessionstate mode="inproc" cookieless="false" timeout="20"/>
</configuration>
VB for using session
Session("Key") = value
If you're only looking to store the UserName, I suggest using the ASP.NET Membership (http://www.4guysfromrolla.com/articles/120705-1.aspx). It will automagically take care of your authentication and give you access to a user's Identity whenever they send a request to the server.