Issue using Session in MVC Actions with [authorice]
- by Pablo Gonzalez
Hi all, first of all sorry for my poor English!
When I use the [Authorice` attribute i can't get Session data that i stored before. For example:
public ViewResult Index()
{
// do some stuffs
Session["Test"] = "Hi stackoverflow!";
}
And then i try to get it in another action, but with the [Authorize] attibute
[Authorize]
public ViewResult Test()
{
// do some stuffs
if(Session["Test"] == null)
{
//do some stuffs
}
}
Session["Test"] is always null, but if i remove the attribute it's work, may anyone help me?, thanks a lot!!!
P.S: I instance Session["Test"] in Session_Start