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

Loging out a user

Guest
Apr 02, 2008 Apr 02, 2008

Copy link to clipboard

Copied

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>

TOPICS
Getting started

Views

541

Translate

Translate

Report

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
LEGEND ,
Apr 03, 2008 Apr 03, 2008

Copy link to clipboard

Copied

Don't cache your pages.

Votes

Translate

Translate

Report

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
Guest
Apr 03, 2008 Apr 03, 2008

Copy link to clipboard

Copied

Do you have any example? I just want this to happen when the user logs out.

Thanks

Votes

Translate

Translate

Report

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
LEGEND ,
Apr 03, 2008 Apr 03, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
LEGEND ,
Apr 03, 2008 Apr 03, 2008

Copy link to clipboard

Copied

it usually happens because user's browser caches the visited pages. this
is default browser behaviour.
you can prevent your pages from being cached by using appropriate meta
tags and/or cfheader tags. google 'coldfusion prevent page caching' for
more info.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Votes

Translate

Translate

Report

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
Guest
Apr 03, 2008 Apr 03, 2008

Copy link to clipboard

Copied

LATEST
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>

Votes

Translate

Translate

Report

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
Documentation