Skip to main content
April 3, 2008
Question

Loging out a user

  • April 3, 2008
  • 2 replies
  • 577 views
Hi everyone, i have found in my application that when you click on the Logout button it will log you out but if you click on the back button of the browser instead of relocating you to the login.cfm, It will show you all the history in the browser.

Any ideas of how to get rid of this problem?

<cfif isDefined('URL.logout')>

<!--- Ends session --->
<CFLOCK SCOPE="Session" TYPE="Exclusive" TIMEOUT="10">
<CFSET StructClear(Session)>
</CFLOCK>

<!---Redirects to login--->
<CFLOCATION url="/mcl_sistema/login.cfm" addtoken="no">

<cfelse>

This topic has been closed for replies.

2 replies

April 4, 2008
I have my application.cfm redirecting to login.cfm but when the user clicks on the back button it will show the last page. If they try to do something then it will redirect them to the login.cfm
I am using StructClear(Session) and
<CFLOCK SCOPE="Session" TYPE="ReadOnly" TIMEOUT="10">
<CFIF Session.LoggedIn>
<CFIF CGI.SCRIPT_NAME IS NOT "/mcl_sistema/Login.cfm">
</CFIF>
<CFELSE>
<CFIF (CGI.SCRIPT_NAME IS NOT "/mcl_sistema/login.cfm")
AND (CGI.SCRIPT_NAME IS NOT "/mcl_sistema/Verificalogin.cfm")>
<CFLOCATION URL="/mcl_sistema/Login.cfm" ADDTOKEN="No">
</CFIF>
</CFIF>
</CFLOCK>
Inspiring
April 3, 2008
Don't cache your pages.
April 3, 2008
Do you have any example? I just want this to happen when the user logs out.

Thanks
Inspiring
April 4, 2008
quote:

Originally posted by: ayuso_15
Do you have any example? I just want this to happen when the user logs out.

Thanks

In that case, the "don't cache the page" method won't work.

If you want, you can let them do it. From a security standpoint, they were allowed to see those pages anyway. From a functional standpoint, put something in your application.cfc so that if they submit any forms or select any links while they are not logged in, they get re-directed to your login page.