views:

818

answers:

3

If I write Session["asdf"] = 234;

In my asp.net web app, does this mean the client will have a cookie stored on their browser?

+12  A: 

Yes, but 234 won't be stored in the cookie. The cookie will only contain a unique ID (for example, lit3py55t21z5v55vlm25s55). Every time ASP.NET sees that unique ID, it will look up the corresponding session information.

If you don't want to use cookies, you can put the session ID in the URL. Read this MSDN article's section on Cookieless SessionIDs.

amdfan
+2  A: 

Session variables are kept on the server, but the user will have a cookie that identifies his session.

Ovidiu Pacurar
+1  A: 

There is a SessionID stored as a cookie in your browser in most circumstances. ASP.NET does allow "cookieless" sessions (though to be honest I've never seen this used in the real world):

http://msdn.microsoft.com/en-us/library/aa479314.aspx

Keltex