Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session ends if another IE Browser is opened.

Status
Not open for further replies.

evergrean100

Technical User
Dec 1, 2006
115
US
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.

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

Application.cfm:
Code:
<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:
Code:
<cfquery...
select from loginTable where username = '#Form.Username#'
and ......
</cfquery>

<cfset Session.AuthLogin = 'True'>
<cfset Session.AdminLogin = Form.Username>

Here is what I have on the top of each one of my protected pages:
Code:
<cfif isDefined("Session.AuthLogin") is NOT TRUE>
    <!--- Session is over or not valid so go to loginPage ---> 
    <cflocation url="loginPage.cfm">
<cfelse>
..see the Cold Fusion protected page
</cfif>

Please advise.
 
Use a database and assign a session.userid

Your using session tracking for individual Browsers

<CFQUERY DATASOURCE="youdb" NAME="Login" >
SELECT ID
FROM Loger
WHERE UserId = '#FORM.UserID#'
AND PasswordID = '#FORM.Pwd#'

</CFQUERY>

<!---If it was an invalid login, send them back to the login page --->
<CFIF Login.RecordCount IS "0">
<cfset session.userID = "0">
<CFLOCATION URL="../Login.cfm?error=loginfail" addtoken="No">

<!---Otherwise send them to the home page of the application --->
<CFELSE>
<cflock timeout="60" throwontimeout="no" scope="Session" type="EXCLUSIVE">
<CFSET Session.userID = Login.ID>
</cflock>
<CFLOCATION URL="../index.cfm" addtoken="No">
</cfif>
 
Thanks, I tried that and still have same issue.
Any other suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top