|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Session management and the browser's back button
I have an application where access is controlled by using session management and a valid login. This is my Application.cfm file:
<!--- Sets up session management ---> <CFAPPLICATION NAME="NCDLogin" SESSIONMANAGEMENT="Yes" SETCLIENTCOOKIES="Yes"> <!--- Clears session if browser window is closed ---> <CFIF IsDefined('Cookie.CFID') AND IsDefine('Cookie.CFTOKEN')> <CFSET localCFID = Cookie.CFID> <CFSET localCFTOKEN = Cookie.CFTOKEN> <CFCOOKIE name="CFID" value="#localCFID#"> <CFCOOKIE name="CFTOKEN" value="#localCFTOKEN#"> </CFIF> </cfif> <!--- Set data source ---> <CFIF NOT IsDefined("APPLICATION.DSN")> <CFSET APPLICATION.DSN = "NCD_OLE"> </CFIF> There are parts of the application that contain links outside my application directory structure. If the user selects one of the links, I need to cancel the session, forcing them to log in for access again. No matter what I try, the back button on my browser always allows access to the last visited page. However, once they get to that last visited page, the session has been cleared and the next page they try to connect to inside my application sends them to the login screen. So, my question is how do I disallow the back button on the browser? |
|
#2
|
|||
|
|||
|
There's no real way to disable the back, but there's some javscript hacks you can use, try this one:
http://developer.irt.org/script/311.htm Look at item 4. |
|
#3
|
|||
|
|||
|
Instead of disabling the back button of the browser, try using a session variable which u can clear once the user finishes using a page. On the page load function of the page that should not be reached thru back button, check for the session variable content. If the user navigates back, the session variable which has been cleared/changed can control the page load
hope this helps |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Cold Fusion Development > Session management and the browser's back button |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|