1 Reply Latest reply on Nov 29, 2009 2:37 PM by BKBK

    CFLocation Issue

    apocalipsis19 Level 1

      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!

        • 1. Re: CFLocation Issue
          BKBK Adobe Community Professional & MVP

           

          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.