I'm still a novice when it comes to session security issues. The
problems I'm trying to solve may be fairly common, but I haven't seen
examples of solutions in any of the books I've looked at.
I currently have a page called 'login.php' which requires the user to
provide a userid/password combination. If the user logs in successfully
(i.e., the supplied userid/password combination is in the mysql
database), the user is directed to a page called 'user_view.php' . This
page contains a form which allows the user to update certain data for
their account, such as email address and telephone extension.
The owners of the site would like me to modify the site in the following
ways:
1. If a user, who has logged in successfully, navigates to another web
site within the same browser session, and then attempts to use the Back
button to return to the 'user_view.php' page within the same session,
they will be redirected back to 'login.php' and required to log in again.
2. If the 'user_view.php' page remains static (i.e., no user
interaction) for a fixed number of minutes (to be determined), the user
is also redirected back to the login page.
In both cases, the purpose is to guard against situations where there
may be multiple users on the same computer within the same browser session.
However, I've tested problem #1 with the web page for my credit union's
web site, and they don't seem to have addressed this issue. With my
credit union, if I log in successfully to my account information, I can
still browse to other web sites and then use the Back button to return
to my 'secure' account information. So I don't know how easy/hard it is
to solve problem #1.
I have a basic understanding of how to set session variables or cookies
when a user hits a particular page. However, I'm not clear on how I
would unset these variables or cookies if the user leaves the site
within the current browser session. I don't know if this is a common
problem or not.
Is there a way to set a cookie containing a value such as 'user_logged',
which expires when the user leaves the page? Can anyone point me to some
examples that address these issues?
problems I'm trying to solve may be fairly common, but I haven't seen
examples of solutions in any of the books I've looked at.
I currently have a page called 'login.php' which requires the user to
provide a userid/password combination. If the user logs in successfully
(i.e., the supplied userid/password combination is in the mysql
database), the user is directed to a page called 'user_view.php' . This
page contains a form which allows the user to update certain data for
their account, such as email address and telephone extension.
The owners of the site would like me to modify the site in the following
ways:
1. If a user, who has logged in successfully, navigates to another web
site within the same browser session, and then attempts to use the Back
button to return to the 'user_view.php' page within the same session,
they will be redirected back to 'login.php' and required to log in again.
2. If the 'user_view.php' page remains static (i.e., no user
interaction) for a fixed number of minutes (to be determined), the user
is also redirected back to the login page.
In both cases, the purpose is to guard against situations where there
may be multiple users on the same computer within the same browser session.
However, I've tested problem #1 with the web page for my credit union's
web site, and they don't seem to have addressed this issue. With my
credit union, if I log in successfully to my account information, I can
still browse to other web sites and then use the Back button to return
to my 'secure' account information. So I don't know how easy/hard it is
to solve problem #1.
I have a basic understanding of how to set session variables or cookies
when a user hits a particular page. However, I'm not clear on how I
would unset these variables or cookies if the user leaves the site
within the current browser session. I don't know if this is a common
problem or not.
Is there a way to set a cookie containing a value such as 'user_logged',
which expires when the user leaves the page? Can anyone point me to some
examples that address these issues?
Comment