user1079925
user1079925

Reputation: 541

Session variables MVC3

Is there an easy way to see what session variables exist and their values using Visual Studio running an MVC3 application in debug mode.

Thanks

Upvotes: 0

Views: 362

Answers (2)

UnitStack
UnitStack

Reputation: 1185

You could output something like this:-

foreach (string key in Session.Keys)
{
    Response.Write(key + " - " + Session[key] + "<br />");
}

Upvotes: 1

kapsiR
kapsiR

Reputation: 3177

Of course, it's a "normal" ASP.NET application: Try Request.RequestContext.HttpContext.Session

Normally you can use "Session" directly, e.g.

Session["key"]

You may try it in an immediate window in debug mode ...

Upvotes: 0

Related Questions