Session Timeout Redirect

This is a discussion on Session Timeout Redirect within the Cold Fusion forums in Application Servers & Tools category; When a user's session times out as specified in cfapplication sessiontimeout, my users are directed to a page if they hit refresh or click on one of the page links. Works just like it should, however... Where/how do I specify the page to which I would like them redirected?...

Go Back   Application Development Forum > Application Servers & Tools > Cold Fusion

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-27-2008, 12:57 PM
health-pact
Guest
 
Default Session Timeout Redirect

When a user's session times out as specified in cfapplication sessiontimeout,
my users are directed to a page if they hit refresh or click on one of the page
links. Works just like it should, however...

Where/how do I specify the page to which I would like them redirected?

Reply With Quote
  #2  
Old 08-28-2008, 06:21 AM
A***
Guest
 
Default Re: Session Timeout Redirect

If you do not have too many pages, you can put the session check and
redirection at the top of each template. If on the other hand you have many
pages, it may be advisable to use a custom tag to do the check and redirection.
Use a session variable that is unique to the user and always exists during the
user?s session.

<cfif not isDefined("session.memberId")>
<cflocation url="loginPage.cfm" />
<cfabort />
</cfif>


Reply With Quote
  #3  
Old 08-28-2008, 06:50 AM
Azadi
Guest
 
Default Re: Session Timeout Redirect

put it in your Aplication.cfc/.cfm

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Reply With Quote
  #4  
Old 08-28-2008, 08:45 AM
A***
Guest
 
Default Re: Session Timeout Redirect

If the redirection is put inside Aplication.cfc/cfm, once the session times out the user will never be able to get back in. The user will be redirected at every attempt to open a page.
Reply With Quote
  #5  
Old 08-28-2008, 08:48 AM
Azadi
Guest
 
Default Re: Session Timeout Redirect

well, obviously, put the redirect code inside a cfif which does not
redirect for a page (or pages)you want to send the timed-out user to.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Reply With Quote
  #6  
Old 08-28-2008, 09:14 AM
health-pact
Guest
 
Default Re: Session Timeout Redirect

Thanks for all of the suggestions. The redirect at the top of each page did
not work. The "session timed-out" redirect was apparently happening in
application.cfm.

I have a weird web site which is a web site in wwwroot, with an
application.cfm, and another web site in a directory in wwwroot, with a second
application.cfm. When I hit the time-out, I was actually being sent back to the
application.cfm in wwwroot.

So, in the wwwroot appl.cfm, I added a check for a timed out session and a
check for HTTP_REFERER from the second web site, and that works.


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:11 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.