Skip to main content
Known Participant
August 27, 2007
Question

Lose Session when opening up another Browser

  • August 27, 2007
  • 1 reply
  • 256 views
I have protected pages using MX 7, where only people that are logged in can view the pages. The problem is if I have a Cold Fusion protected page up in the first browser and I open a second browser in IE the session goes away in the first Cold Fusion Browser page.

For example I log in and then view the cold fusion page in IE 6 Broswer where I view the protected mypage.cfm web page, and then open up a second IE Browser page where I view an html or any other page called otherpage.html. If I go back to the mypage.cfm in the first Browser and refresh the page I lose my session and it logs me out. This does not happen in Netscape 7.
The bottom line is the only way to keep the session valid in mypage.cfm is to not open up any other IE Browser.

Please advise how I can correct this issue. Here is what I have:

Application.cfm:

<cfapplication name = "My_application_name"
sessionManagement = "Yes"
sessionTimeout = #CreateTimeSpan(0,0,60,0)#
setClientCookies = "Yes">


<cfif IsDefined('Cookie.CFID') AND IsDefined('Cookie.CFTOKEN')>
<cfset localCFID = Cookie.CFID>
<cfset localCFToken = Cookie.CFTOKEN>
<cfcookie name="CFID" value="#localCFID#">
<cfcookie name="CFTOKEN" value="#localCFToken#">
</cfif>


login page:

<!--- Settings for the successful login information --->
<cfset Session.AuthLogin = 'True'>
<cfset Session.AdminLogin = Form.Username>



Here is what I have on the top of each one of my protected pages for example mypage.cfm:


<cfif isDefined("Session.AuthLogin") is NOT TRUE>
<!--- Session is over or not valid so go to loginPage --->
<cflocation url="loginPage.cfm">
<cfelse>
<!--- View the Cold Fusion protected page info .... --->
</cfif>


Please advise.
    This topic has been closed for replies.

    1 reply

    Participating Frequently
    August 29, 2007
    It's hard to say, but I've definitely seen the behavior before.

    To help you troubleshoot, I would try to nail down exactly what's happening by tracking the CFID and CFTOKEN values being assigned to each browser window. You can do this by entering the following into the address bar in IE:

    javascript: document.write( document.cookie );

    Is the second browser window getting the same CFID and CFTOKEN as the first browser window? Or is the second browser window getting a "new" session? Once the second browser window is opened, does the first browser window keep its original session, or has it assumed the same session as the second window?