This content has been marked as final. Show 5 replies
I think you can put code for checking session at onRequestStart. If the login session is not exist, then redirect your user to login page.
Try the code below. Place it in your application.cfm
Since application.cfm is always called on every page, you users will be redirected to your login page once the session has ended. I user session.userID as an example. You can use any session variable that you have previously set up.
I tried the same code in my application.cfm file. But what it does is stopped the loading of the login page(index.cfm). I give you a brief overview of my code
<cfif #Session.Qlkid# EQ "">
Value of the session variable is set once the user logs into the site with a valid username and password
just add the check for the requested page into your cfif:
<cfif getfilefrompath(cgi.script_name) neq "your-login-page.cfm" AND
(NOT structkeyexists(session, "Qlkid"))>
this solution worked out fine.
Thanks a lot