Solved

Does anyone know how to create a login validation in ColdFusion that will recognize that a user has closed a given tab that contained the app and make them log back in?

Posted on 2009-04-07
5
143 Views
Last Modified: 2014-10-18
I am trying to find a ColdFusion Tag or code that would be able to handle the logging in of a given user.  I have an application that I allow the user to login and logout without any problems. But when they login and just close the tab that contains the application and then go back and open a new tab and go to the same secure site they are already logged in. I was just trying to fix this where the user will be required to log back in.

Anyone have any ideas?

0
Comment
Question by:wesmarmd
5 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 250 total points
Comment Utility
Try adding a session cookie.  Session cookies expire when the window is closed.  
<cfcookie name="isLoggedIn" value="true">  --- no expire date

Then test to see if the cookie still exists when you return

 <cfif NOT isDefined("cookie.isLoggedIn")>
    <h1>YOU ARE LOGGED OUT</h1>
 </cfif>


You cannot terminate a session when someone leaves your site, however, you could detect when they go to your site from another site.  That is, when they return to your site.  Check the cgi.referrer variable to see if they are coming from somewhere else..
0
 
LVL 1

Assisted Solution

by:vonRogue
vonRogue earned 250 total points
Comment Utility
If you're talking about a user having multiple tabs open in a browser like Firefox, there's no way to tie your session to just one of the tabs. As long as they keep the browser open with at least one tab open, they will be able to access your site without logging in again (as long as they do it before the server's session time expires).

Now if you're talking about how the user stays logged in even after closing down the browser completely, you will need to enable J2EE Session Management in the CF Administrator's Memory Variables Page. By default, it's set to Coldfusion Session Management, but that has the nasty side effect of keeping the session in place even after the user closes the browser.
0
 

Author Comment

by:wesmarmd
Comment Utility
I was trying to solve the problem of a user closing an individual tab and not the whole browser. I am aware of the J2EE session setting in the administrator. I sure wish there was a away to detect whether the tab had been closed. I sure would think that in the future other people are going to want to know if the tab had been closed out.

Thanks for your insight.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now