ASDFdotASPX
ASDFdotASPX

Reputation:

Is asp.net session information stored in a cookie?

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?

Upvotes: 10

Views: 3654

Answers (3)

ine
ine

Reputation: 14084

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.

Upvotes: 15

Keltex
Keltex

Reputation: 26426

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

Upvotes: 2

Ovidiu Pacurar
Ovidiu Pacurar

Reputation: 8209

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

Upvotes: 4

Related Questions