Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > ColdFusion

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-05-2007, 09:31 PM   PM User | #1
florida
Regular Coder

 
Join Date: Jul 2002
Posts: 362
Thanks: 0
Thanked 0 Times in 0 Posts
florida is an unknown quantity at this point
Session ends if another IE Browser is opened

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 click on a link that leads to another session protected page, it kicks me out of the session and takes me to my login page. 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.
florida is offline   Reply With Quote
Old 09-17-2007, 10:05 PM   PM User | #2
Shift4Sms
Regular Coder

 
Join Date: Jul 2002
Location: Las Vegas, NV - USA
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Shift4Sms is an unknown quantity at this point
I think your issue is with the first chunk of code. The following is not needed and may be interfering:
Code:
<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>
The setClientCookies="yes" parameter in the CFAPPLICATION tag does this for you.
__________________
Steven Sommers (blog)
Shift4 Corporation -- www.shift4.com

Creators of $$$ ON THE NET(tm) payment processing services.
Shift4Sms is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:10 AM.


Advertisement
Log in to turn off these ads.