CFLOGIN works, but not simultaneously on different servers/broswers

I'm using CFLOGIN with application.cfc which works great when I test it - I'll call it login session A in browser window 1.
When I simultaneously log into the same app on a different server with a different username (login session B in browser window 2), I can't login - unless I log out out of session A/browser window 1 first. Something in my new code is preventing me from logging into my app more than one time, even when the apps are on separate servers and I'm using different usernames.
We have the same app on various servers (test/development/production), and I used to be able to login on 2-3 browsers or servers at a time - and I never had a problem until recently when I made some changes to the application.cfc and login code.
I updated the code because before the session scopes and login credentials were not being initiated and terminated together (upon login/logout). Before, a user was clicking 'logout' and it was clearing the session scopes without invoking CFLOGOUT. Now, I fixed that, but I have another problem, which is that I can't log into the application on two different browsers or servers at the same time (even if I'm using different login usernames). Any suggestions would be appreciated.
<cfcomponent displayname="Application" output="false">
    <cfset this.name = 'SampleApp'>
    <cfset this.SessionManagement = true>
    <cfset this.SetClientCookies = true>
    <cfset this.SessionTimeout = CreateTimeSpan( 0, 0, 5, 0 ) />
<cffunction name="onSessionStart" access="public" returntype="void" output="false">
    <cfset session.hostname = 'http://'&#CGI.HTTP_HOST#&'/'>
    <cfset session.dbase = 'localdb'>
    <cfset session.roles = ArrayNew(1)>
    <cfreturn>
</cffunction>
<cffunction name="onApplicationStart" access="public" returntype="boolean" output="false">
    <cflog file="SampleApp" type="information" text="Application started." />
    <cfreturn true>
</cffunction>
<cffunction name="onApplicationEnd" returntype="void" output="false" hint="Executes on session timeout or if server shuts down.">
    <cfcookie name="CFID" value="#CFID#" expires="now">
    <cfcookie name="CFTOKEN" value="#CFTOKEN#"  expires="now">
    <cfreturn>
</cffunction>
<cffunction name="onRequestStart" access="public" returntype="void" output="true" hint="Executes before each page processes.">
    <cfargument name="targetPage" type="String" required="true"/>
        <cfsilent>
        <cfif GetAuthUser() NEQ ''>
            <cfif NOT isDefined('session.uname')>
                <cfif CGI.HTTP_REFERER DOES NOT CONTAIN "login.cfm">
                    <cfinclude template="expired.cfm">
                    <cfabort>
                </cfif>
            </cfif>
        </cfif>
        <cflogin>  
            <!--- Flash Remoting setCredentials() passes cflogin.user and cflogin.password using checklogin.cfc --->
            <cfif IsDefined('cflogin')>        
                <cfquery name="qValidateLogin" datasource="#session.dbase#" username="#cflogin.name#" password="#cflogin.password#">
                    SELECT    role
                    FROM    session_roles
                </cfquery>
                <cfif qValidateLogin.RecordCount GT 0>
                    <cfloginuser name="#cflogin.name#" password="#cflogin.password#" roles="#qValidateLogin.ROLE#">
                    <cflog text="User - #cflogin.name#" type="Information" file="Filename" date="yes" time="yes">
                <cfelse>
                    <cfinclude template="login.cfm">
                    <cfabort>
                </cfif>
            <cfelse>
                <cfif right(arguments.targetPage,10) is "logout.cfm">
                    <cflocation url="index.cfm">
                    <cfabort>
                <cfelse>              
                    <cfinclude template="login.cfm">
                    <cfabort>  
                </cfif>          
            </cfif>
        </cflogin>
        </cfsilent>      
</cffunction>
</cfcomponent>

Oh no, that was my mistake. Thank you for catching that! That query is currently not being used on my Application.cfc page, which is why I wasn't having problems with it, but I'm glad you pointed it out to me. I had that code in my Application.cfc file just incase I wanted to check login from somewhere else, but my login query is actually being called with Flash Remoting using setCredentials() to connect to login.cfc. This is the correct query in my login.cfc file:
            <cfquery name="qValidateLogin" username="#session.uname#" password="#session.pword#" datasource="#session.dbase#">
                select role from session_roles where role like 'xxxxx%'     
            </cfquery>
I do think I figured out a solution to my problem though. I found out how to use applicationToken, which I understand if it is not set, by default will be the value of application.Name. If you want users to be able to log into multiple instances of  your application at the same time, you would give the applicationToken the same value. This would be great for clustered servers or sites with sub-domains.
If you wanted to force only one login for the three different sites, you could give this a different value. VERY useful. So I have:
<cfcomponent displayname="Application" output="false">
    <cfset this.name = 'SampleApp'>
    <cfset this.SessionManagement = true>
    <cfset this.SetClientCookies = true>
    <cfset this.SessionTimeout = CreateTimeSpan( 0, 0, 5, 0 ) />
    <cfset this.loginStorgage = "session">
    <cfset this.applicationtoken = 'SampleAppSub'>
Now, I can log into this site on my development machine with multiple browsers pointing to the same site hosted on different servers - with no problem. I never had an issue with this before, but something else I recently added into my code in Application.cfc made this not work. I should probably also mention that I work on many different applications that all use the same application.Name even though they are different sites - we do this so the same settings can be deployed on different servers.
With the applicationToken settings, I have it working again. Perhaps what made it break was setting this.loginStorage = "session"? Before this was not set and was using the default value of  "cookies" which I didn't want - because my site is used by different people on the same box and we have clustered servers.

Similar Messages

  • Firefox is rendering a page in quirks mode on one machine, but not on a different machine.

    I have two machines that are going to the same website. One machine renders the page correctly, the other enters quirks mode and nothing appears on the screen.
    The machine that is not working is running OS X 10.6.4. The one that is working is running 10.4.11.
    I tried deleting the preferences, and reinstalling Firefox.
    This is a brand new install of the OS and was the first time we tried access this website.

    The problem is due to a call to getVolumeInformation. It works on my desktop but not on a different machine which has different drives and partitions etc. I'm returning the file system type of the fixed drives, however on certain fixed drives it fails. At first I thought it was failing on logical drives but that does not seem to be the case.This is nonsense in terms of your original post.
    Perhaps you meant to say that some of your native methods work and others dont? And the one and only way that they don't work is because you get the link error? If yes then I already told you what the reason is.
    Conversely there is some other failure, which has nothing to do with a link error. And thus it is pointless to continue to discuss this unless you actually explain what is happening.

  • Problem with drivers for HP B109 a-m all-in-one, have printer working but not scanner in windows 8

    Still have a problem with the drivers in Windows 8 release preview, for my HP B109 a-m all-in-one, have printer working but not scanner, is there any chance of a fix before final release of Windows 8 ?.

    Review my post here:
    http://h30434.www3.hp.com/t5/Windows-8-Release-Preview/SOLUTION-Get-Win-7-Printer-Drivers-HP-Solutio...
    And see if something similar will work for you.

  • My Mac Mini doesn't recognize my Avengers DVD--it keeps saying "Supported disc not available." I've tried other DVD's which work, but not this one. itunes and everything else has been updated to the newest versions. Help?

    My Mac Mini doesn't recognize my Avengers DVD--it keeps saying "Supported disc not available." I've tried other DVD's which work, but not this one. itunes and everything else has been updated to the newest versions. Help? Also...It doesn't recognize the digital copy DVD.

    I have ALL the exact same symptoms as on my home computer.
    It sure sounds to me like something on the iPod is broken. If it's under warranty then I would send it back for repair. If not, check out some of the web repair services, such as iPodResQ etc.

  • Allt he links in the header of any websites are not working, I reinstalled fiorefix and it s the same. No problem in others browser. the tool bar is working but not the link sinside the web page located between the top 300px height

    all the links in the header of any websites are not working, the cursor is not changing into pointer and no way to click on any link located at the top of any website page. I reinstalled firefox and it s the same. No problem in others browser. the tool bar is working but not the links inside any web page located between the top 300px height.
    So I can t tlog into any website, i cant write an email as the compose button is located in the top of the page.. Please help, i have all my bookmarks into my firefox...

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Speakerphone problem - lost voice from speakerphone while playing music or gaming youtube, while call or voice recording playing - all works fine, so speakerphone is working but not on all apps. hard reset done - no changes

    or gaming youtube, while call or voice recording playing - all works fine, so speakerphone is working but not on all apps. hard reset done - no changes.
    iphone 4
    SOLVED plugin to charger solved it - so problem was with contacts -- no idea why - phone is new - no water - no havy dust - usual using  
    hope will never return. Thanks

    We checked it with an iPhone 5 in house multiple times and could not reproduce this Problem. Must be something specific to your device. Maybe your speakerphone volume is turned down completely?
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • Hi!My 6 month old MBP 13" has suddenly stop charging.Mac is working,but not charging

    Hi!My 6 month old MBP 13" has suddenly stop charging.Mac is working,but not charging

    Troubleshooting MagSafe adapters  http://support.apple.com/kb/ts1713
    If you need to pursue further you can do it on-line,  start here
    https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • My iPad cannot connect to my internet.  the internet is working but not with my ipad.

    my iPad cannot connect to my internet.  the internet is working but not with my ipad.

    Call your ISP (Internet Service Provider) and explain them your issue, it could range from having your router configured incorrectly to having a wiring issue. Personally, I have Comcast and they are great, no issues, and awesome customer service.
    Hope you get up and running ASAP

  • How do I delete photos on iPad but not simultaneously on my macbook pro?

    How do I delete photos on iPad but not simultaneously on my macbook pro?
    I have too much memory taken up by the photo's and all are on my Pro.'when i try to delete from the ipad I get asked if I want to remove from all sites but dont get an option?
    Cheerz
    Deb

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • HT4993 My volume down button is not working.  The UP button works, but not the down button.  I have tried to restart it and that didn't solve the problem.

    My volume down button doesn't work on my iPhone.  The UP buttown works, but not the down button.  I have tried a hard reset and that didn't fix it.

    Try this.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • ICloud keeps asking for password but will not take it. All other devices work but not my IMac???

    ICloud keeps asking for password but will not take it. All other devices work but not my IMac???

    Exactly which password are you inputting? iCloud looks for your AppleID password.

  • Wake on Lan (works, but not always)

    Iam trying to get Wak on Lan working on my iMac. It works, but not always. When I put my mac to sleep en send the magic package, my mac turns back on. But when my mac turns to sleep and I wait a few hours (the next morning), my Mac doesn't respond to the same magic packag. When I wake up the Mac by hand, and put it back to sleep again, the magic package works again en turns the mac on.
    It almost looks like the mac goes into a deeper sleep mode after a few hours. Does anyone knows what could ben the reazon.

    mmm, It seems like my mac doesn't always turns to sleep mode. Most of the time it only turns off the screen (solid light). My energy settings are 10 minutes for the screen and 15 minutes for the mac. But after turning of the screen it never turns to sleepmode. Ecxept when I put it to sleep manualy.
    Strange thing is: when the screen is turned of, shouldn't I be able to get tot my files... (I can't actualy).

  • Sap xi SCENARIO source directory working ,but not working target directory

    sap xi SCENARIO source directory working ,but not working target directory..
    plz help me

    Hi,
    Be more specific on the problem you are facing so that the ppl here can help..
    looks like your are trying to file to file scenario and the file is not generating at the target folder ...
    then check the communication logs of the receiver adapter using RWB->CC logs..
    post the error you have received there..
    HTH
    Rajesh

  • Can't sync ical on my iphone and imac. email and note work but not ical.  can anyone help.

    can't sync ical on my iphone and imac. email and note work but not ical.  can anyone help.
    thanks
    bmoreimac

    So how can i make it work that way, i asked one of my friends, and she says it works like that...when she delete the email on her iphone it is deleted on the mac too, what do i do to change this?....my mail it's hotmail, i don't know if its relevant

  • TS1702 facetime on my iphone works but not on my ipad

    Facetime on my iPhone 4S works but not on my iPad (3rd or 4th Gen)

    From the iPad User Guide:
    To use FaceTime, you need an Apple ID and a Wi-Fi connection to the Internet. When you open
    FaceTime, you may be prompted to sign in using your Apple ID, or to create a new account.
    Make a FaceTime call: Tap Contacts, choose a name, then tap the phone number or email address the person uses for FaceTime.
    You can also make a FaceTime call from the Contacts app.
    Rotate iPad to use FaceTime in either landscape or portrait orientation. To avoid unwanted orientation changes, lock iPad in portrait orientation. See Portrait and landscape orientation on page 20.

Maybe you are looking for

  • Bounced audio is seconds shorter, but not when re-imported...

    Hi - I'm scoring to video (.mov file).  I have hits in specfic spots, and my client was complaining that things weren't lining up.  The time - let's say at :45 looks correct on the video, but when I bounce the audio and play it back in Quicktime, tha

  • "Add Bookmark" = expanded dropdown list

    When I want to add a Bookmark in Safari 3.0.4, I click on Bookmarks / Add Bookmark, and I get a little window asking where I want to keep this bookmark. If I click on the drop-down list arrows, a very lengthy, fully-expanded list of all my bookmark f

  • Can't pan (hand tool) when zoomed out

    Hi, 1. make a document 2. zoom out so you can see the boundary of the canvas 3. try to pan using the "hand tool" -> cant pan, canvas stays in middle 4.  - zoom in just enough so the boundary of the canvas exceeds your viewport -> can pan now (but whe

  • I don't know how I can optimize this SQL

    Dear ALL: I don't know how I can optimize this SQL. Is it possible to make a better SQL or PL/SQL? Please let me know your good thought. Thank you. Sincerely, =========================================================== (SELECT     A, B, C, SUM(D) as

  • S.M.A.R.T. on fasttrak controller?

    I have 2 IDE harddisks connected to the Promise Fasttrak, and I would like to monitor their temperatures with speedfan. I was able to do this when these disks were connected to the VIA controller, before I moved them yesterday. But now speedfan does