jbtman
Programmer
- Jul 13, 2007
- 30
I have web appliation done that uses master pages. I have two content pages, Default and Account. When the application loads Default loads and allows the user to log in. This sets a session variable this way
HttpContext.Current.Session.Add("UserValidated", True)
and then redirects to the Account page
There is a logout button on the account page that does this
HttpContext.Current.Session.Item("UserValidated") = "False"
HttpContext.Current.Session.Abandon()
HttpContext.Current.Session.Clear()
Response.Redirect("Default.aspx")
I have a session checking function in place in the page events of the master page.
Now if I try to go to the Accounts page directly without logging in it succeeds as the Session checking function does not get called.
In the master page I have tried putting the session check function in the page load, init, preinit and everywhere else I can think of!!
Any help would be appreciated!!
HttpContext.Current.Session.Add("UserValidated", True)
and then redirects to the Account page
There is a logout button on the account page that does this
HttpContext.Current.Session.Item("UserValidated") = "False"
HttpContext.Current.Session.Abandon()
HttpContext.Current.Session.Clear()
Response.Redirect("Default.aspx")
I have a session checking function in place in the page events of the master page.
Now if I try to go to the Accounts page directly without logging in it succeeds as the Session checking function does not get called.
In the master page I have tried putting the session check function in the page load, init, preinit and everywhere else I can think of!!
Any help would be appreciated!!