Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFLocation Issue

Participant ,
Nov 24, 2009 Nov 24, 2009

Hello Community,

I have the following CFLocation that gets executed if the user's session has timed out:

<cfif variables.ryn EQ "N">

   <cflocation addtoken="#application.addt#" url="#session.dlog#/login_pls.cfm/logrd/chkout">

   <cfabort>

</cfif>

In my website I am also using ISAPI.

The page redirects the user to the login page but instead of showing the URL:

www.mysite.com/login_pls.cfm/logrd/chkout

It shows the page where it came from:

www.mysite.com/pageittimedouton

Now, I need the URL information "chkout" so I can send the user back to where he came from.

Any thoughts as of why this cflocation operation is not working?

Thanks!

TOPICS
Advanced techniques
354
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2009 Nov 29, 2009
LATEST

I have the following CFLocation that gets executed if the user's session has timed out:

<cfif variables.ryn EQ "N">

   <cflocation addtoken="#application.addt#" url="#session.dlog#/login_pls.cfm/logrd/chkout">

   <cfabort>

</cfif>

...

...

Any thoughts as of why this cflocation operation is not working?

In my opinion, one part of your design doesn't quite tie in with another. If the user's session (call it session 1) times out, then any session that follows will be different (say, session 2). The session scope in the cflocation code, if it exists, is therefore not the same as the one that has just timed out.

Can't you use a non-session variable in the cflocation? My advice is, you should avoid using the session scope after the session times out. You cannot eat your cake and have it.

The only exception is in onSessionEnd() in Application.cfc. You may use the session scope there, because Coldfusion passes it in as an argument.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources