Session problem
-
Hi! Hope every one is fine, i am facing a problem in session management. I created a session and used it to store the login id and type of user. session goes fine and terminates when user logouts but after user logouts from site and then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page. it should not happen because only authenticated users are allowed to view any page other than login page. Can any body tell me how can i restrict any page of my site to be opened like this? i am new to web development so any kind of help is appriciated. Thanks, Regards, Affan Ahmad Toor
.................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
-
Hi! Hope every one is fine, i am facing a problem in session management. I created a session and used it to store the login id and type of user. session goes fine and terminates when user logouts but after user logouts from site and then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page. it should not happen because only authenticated users are allowed to view any page other than login page. Can any body tell me how can i restrict any page of my site to be opened like this? i am new to web development so any kind of help is appriciated. Thanks, Regards, Affan Ahmad Toor
.................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
Affan Toor wrote:
then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page
You are seeing the cached version of page by browser. You can disable caching for pages and that could solve your problem.
-
Hi! Hope every one is fine, i am facing a problem in session management. I created a session and used it to store the login id and type of user. session goes fine and terminates when user logouts but after user logouts from site and then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page. it should not happen because only authenticated users are allowed to view any page other than login page. Can any body tell me how can i restrict any page of my site to be opened like this? i am new to web development so any kind of help is appriciated. Thanks, Regards, Affan Ahmad Toor
.................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
Basically, all your pages should derive from a base page which checks if the user is logged in, and, if not, redirects to the login page.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hi! Hope every one is fine, i am facing a problem in session management. I created a session and used it to store the login id and type of user. session goes fine and terminates when user logouts but after user logouts from site and then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page. it should not happen because only authenticated users are allowed to view any page other than login page. Can any body tell me how can i restrict any page of my site to be opened like this? i am new to web development so any kind of help is appriciated. Thanks, Regards, Affan Ahmad Toor
.................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
try this: on login page: protected void Page_Load(object sender, EventArgs e) { ......... //if the user is valid Session.Add("user", user); ....... } on other page protected void Page_Load(object sender, EventArgs e) { ....... if (Session["user"]==null) Response.Redirect("login.aspx"); ........ } on logout Session.Remove("user"); I hope that will help you.
-
Hi! Hope every one is fine, i am facing a problem in session management. I created a session and used it to store the login id and type of user. session goes fine and terminates when user logouts but after user logouts from site and then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page. it should not happen because only authenticated users are allowed to view any page other than login page. Can any body tell me how can i restrict any page of my site to be opened like this? i am new to web development so any kind of help is appriciated. Thanks, Regards, Affan Ahmad Toor
.................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
clear the session on log out
Piyush Vardhan Singh Programmer TAS NewDelhi India