• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 967
  • Last Modified:

Session Timeout and Frames

After the user logs in, he is redirected to a frame admin area. If the session variable times out, then it includes the login form (into one of the frames) Is it at all possible to redirect them?

<!--- Application.cfm --->
<cfapplication name="OrthoIntranet" sessionmanagement="Yes" clientmanagement="yes" sessiontimeout="#CreateTimeSpan(0,1,0,0)#">

<!--- If user is not logged in, force them now --->
<cfif NOT IsDefined("Session.Intranet")>
      
      <!--- If user is now submitting "Login" form --->      
      <cfif IsDefined("form.username") AND IsDefined("form.password")>
            <!--- Include "Login Check" now --->
            <cfinclude template="login_Check.cfm">
      </cfif>
      
      <!--- If not display login form --->
      <cfinclude template="login_Form.cfm">
      <cfabort>
      
</cfif>

<!--- Login Check --->
<!--- Find records with username and password --->
<cfinvoke component="Components.Users" returnvariable="qGetUser" method="Login">
      <cfinvokeargument name="username" value="#form.username#">
      <cfinvokeargument name="password" value="#form.password#">
</cfinvoke>

<!--- If the username and password are correct --->
<cfif qGetUser.RecordCount>
      <cflock scope="session" type="exclusive" timeout="10">
            <cfset Session.Intranet = StructNew()>
            <cfset Session.Intranet.UserID = qGetUser.UserID>
            <cfset Session.Intranet.FirstName = qGetUser.FirstName>
      </cflock>
      <cflocation url="index.cfm">
<cfelse>
      <cfset message = "Invalid username and password!">      
</cfif>
0
JRockFL
Asked:
JRockFL
1 Solution
 
pinaldaveCommented:
I did not understand your problem correctly. When do you want to redirect them?
You can always use <cflocation url="someurl" addtocken="yes">

Regards,
--Pinal
0
 
PluckaCommented:
Yes it's possible.

Just target the frame.

<cfif condition eq "True">
    <script language="JavaScript">
        frameName.localtion.assign('page.cfm');
    </script>
</cfif>

Regards
Plucka
0
 
JRockFLAuthor Commented:
I'm trying a different login approach. The application file tests to see if the user is logged in our not. If they are not logged in, it will force them out of the frames to the login page.

The javascript is what I needed. Sorry if I dont not explain myself well.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now