Session is not null but not logged in

Asked

Viewed 123 times

0

I am trying to authenticate a page so that only people who are logged in can access a page. I am using this code.

if (Session["user"] == null)
            RedirectToAction("Login", "Usuario");

But even not logged in it does not enter this if, so I understood is that my application creates a SESSION, so she’s not NULL

  • I did a test here and it worked. Don’t you fill out Session somewhere else? Put in the code for this Action.

  • Only if my app does it by itself.

  • Does this happen in debug? Have you tried logging in to see what’s in Session?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.