Raphael just check the section variable, if there is any session with the validated ID, it allows access when it does not redirect.
As we know the best and safest way to transfer information between different Forms on Asp.net is by using Session variables. In the Session variables we can store any type of object, from robust Datasets to simple integers and/or Strings.
The only problem with these variables is that as we create new variables, our application becomes slower and requires more server resources. Then it is advisable to remove the variables as we no longer need them.
Because the Visual Studio Intelissense does not identify the session variables that we declare, sometimes we forget to remove a certain variable, this can end up generating serious performance problems, and even generating execution errors in our application.
For this we will create a routine that will scan the collection of Session variables and display us the name of each, and the value/type of each session variable declared in our application.
Add a new aspx form to your project called ver_session.aspx,
in the Load Event of our page, add the following code:
Okay, now as we run our application, we can open a new tab/browser window and directly access the ver_session.aspx page of our application. In it we have the name and value of each Session Variable!
Taken from.
I put [Authorize] in the controllers, but I don’t know how to set this up on my web.config.
– Raphael Gumm
@Raphaelgumm When starting an ASP.NET MVC project with Individual User Accounts, this comes configured by default. Still needs the specific snippet?
– Leonel Sanches da Silva
@Gypsy Heart Mendez Please, I’m a little lost yet with this.
– Raphael Gumm