- see footer for list info -<
i think it can be much simpler ..

<cfif isdefined("session.mm_username") is 0>
<cflocation login-page.cfm>
</cfif>

of course, make sure your session time outs are sensible or it can get really irritating for the user to keep having to log in, and a problem for security if they are too long and sessions can be left open forever!

Jenny

http://www.fasttrackonline.co.uk
----- Original Message ----- From: "Kerry" <[EMAIL PROTECTED]>
To: "Coldfusion Development" <[email protected]>
Sent: Friday, August 26, 2005 8:41 AM
Subject: RE: [CF-Dev] Can anyone help me withthis please


>- see footer for list info -<
well, they wont actually get logged out from the page until they perform an
action i.e. click on something?
So you could have in application.cfm or a global file some code like this:


if(not structkeyexists(session,"user")){
session.user = createobject("component","myapp.user").init();
session.urls = createobject("component","myapp.url").init()
}

if(not session.user.loggedin()){
session.urls.setAction("afterlogin",cgi.script_name);
}

then in login.cfm:

if(session.user.loggedin()){
goto = session.urls.getAction("afterlogin");
if(len(goto)){
location url="#goto#"
}
}

_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<




_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to