dannystommen
December 22nd, 2008, 04:46 AM
I have a master page whit an OnInit event. In this event I check if a user is logged in (stored in the session). If not logged in, the user is redirected to the login page.
On my Home.aspx page I have a hyperlinkto Order.aspx with querystring id (both content page of the master page). When the link is clicked, the master.OnInit method is executed, next the order.Page_Load and finally the page Order with the correct id is shown.
Next when I click 'logout', the Session the is Cleared and Abanded, and the user is redirected to the Login page again.
But now, when I type in the adressbar http://localhost:51029/Order.aspx?id=1, both master.OnInit and order.Page_Load are NOT executed. But the order with id 1 is shown, even when the user is not logged in.
it looks like this has the same effect when clicking the 'Previous' button of the browser.
So I placed a label which text property is set to DateTime.Now on the pageload of Order. When I opened the page it's text is "2008-12-22 10:40:33". When I re-load the page via the Home page, the text changes into "2008-12-22 10:41:03". So the pageload is executed (like it should). But now, when I click logout, session is cleared and redirected to login. When I nog type the url in the adressbar, the page is loaded again and label's text is still "2008-12-22 10:41:03".
Am I doing something wrong, or is this a 'bug'? If it is, how can I solve it or is there any workaround?
EDIT: this only happens when the page is already been loaded. So, if I am at the login page for the first time, and type the url in the adressbar, the user is nicely redirected to the login page. So it only fails when the page is opened once, then logged out, and then type the url in adressbar
On my Home.aspx page I have a hyperlinkto Order.aspx with querystring id (both content page of the master page). When the link is clicked, the master.OnInit method is executed, next the order.Page_Load and finally the page Order with the correct id is shown.
Next when I click 'logout', the Session the is Cleared and Abanded, and the user is redirected to the Login page again.
But now, when I type in the adressbar http://localhost:51029/Order.aspx?id=1, both master.OnInit and order.Page_Load are NOT executed. But the order with id 1 is shown, even when the user is not logged in.
it looks like this has the same effect when clicking the 'Previous' button of the browser.
So I placed a label which text property is set to DateTime.Now on the pageload of Order. When I opened the page it's text is "2008-12-22 10:40:33". When I re-load the page via the Home page, the text changes into "2008-12-22 10:41:03". So the pageload is executed (like it should). But now, when I click logout, session is cleared and redirected to login. When I nog type the url in the adressbar, the page is loaded again and label's text is still "2008-12-22 10:41:03".
Am I doing something wrong, or is this a 'bug'? If it is, how can I solve it or is there any workaround?
EDIT: this only happens when the page is already been loaded. So, if I am at the login page for the first time, and type the url in the adressbar, the user is nicely redirected to the login page. So it only fails when the page is opened once, then logged out, and then type the url in adressbar