4 Replies - 3640 Views - Last Post: 03 February 2011 - 09:03 AM Rate Topic: -----

#1 midasxl  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 191
  • Joined: 03-December 08

Session Management CFID changes on every page

Posted 28 January 2011 - 08:34 AM

Hello and thanks for your time. I have researched this like crazy and tried all the things I have found and nothing seems to do the trick. This is just a sanity check.

I have the following Application.cfc settings...

	<!--- Set up the application. --->
	<cfset THIS.Name = "Marks CFC App" />
	<cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 2, 0, 0 ) /
	<cfset THIS.SessionManagement = true />
	<cfset THIS.SessionTimeout = CreateTimeSpan( 0, 0, 20, 0 ) />



In the CF Administrator all memory variables are default. I do NOT have j2EE session management checked; I am using coldfusion session management.

I created two pages session.cfm and session2.cfm

session.cfm:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Session Test</title>
</head>

<body>
<h4>Coldfusion Application using Default Session Management</h4>
<cfoutput>

    <cfdump var="#session#">
    
</cfoutput>
<a href="session2.cfm">Next Page</a>
</body>
</html>



session2.cfm:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Session Test</title>
</head>

<body>
<h4>Coldfusion Application using Default Session Management</h4>
<cfoutput>

    <cfdump var="#session#">
    
</cfoutput>
</body>
</html>



As you can see session.cfm just dumps the session variable which reveals the CFID, CFTOKEN, URLTOKEN, and SESSIONID. An anchor tag then takes me to session2.cfm which has the exact same code as session1.cfm.

The CFID on page two always increments by 1 in relation to the CFID on page one. Shouldn't they be the same? I have attached two screenshots of the two separate session dumps. Note the CFID is different.

Any thoughts, ideas, comments, etc. are most welcome.

Peace!

Attached image(s)

  • Attached Image
  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: Session Management CFID changes on every page

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1912
  • View blog
  • Posts: 3,442
  • Joined: 13-January 08

Re: Session Management CFID changes on every page

Posted 28 January 2011 - 10:10 AM

I've run across this one time before but I'm having trouble remembering what the ultimate cause was. In any event, I have two things for you to try while I try and dredge my brain for what it was.

1./ Along with the dump of the session scope, try dumping the cookie scope as well. Sessions are determined by the session cookies that CF places on your browser. I suspect you'll see them changing as well.

2./ Rather than session2.cfm as your href URL, try putting in the entire http line and make sure it's the same domain as what your session.cfm page is on. That is, it could be a situation where you start at "http://testSite.com/session.cfm" and then the link takes you to "http://www.testSite.com/session2.cfm" and the CF server is seeing those differently.

With that second item, I think I'm getting closer to what I recalled the issue was. It may have something to do with the way you've set up the site in either IIS or Apache. But try those two first and see what you get.
Was This Post Helpful? 0
  • +
  • -

#3 midasxl  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 191
  • Joined: 03-December 08

Re: Session Management CFID changes on every page

Posted 28 January 2011 - 10:34 AM

Thanks for your reply,
Yes the Cookie scope is also incrementing. I have included another screen shot, this time with the Cookie dump. I see a jsessionid in there; shouldn't that only be used if I select j2EE session management in the administrator? Just curious.

I placed absolute URL's in the links that connect the two pages.

Still incrementing. Is the fact that it is https:// an issue?

Thanks!

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#4 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1912
  • View blog
  • Posts: 3,442
  • Joined: 13-January 08

Re: Session Management CFID changes on every page

Posted 28 January 2011 - 10:48 AM

It shouldn't be but at this point you start checking out even the unlikely possibilities. Try running the request as a regular http.

If this is internal dev (a box you control) try turning off all browser security settings and see if that makes a difference. Don't forget to turn them back on.

Try using a different browser and see if that makes a difference.

Do the sessions change when you reload session.cfm? Rather than go to another page, try recycling the one you have and see if that's an issue.

Drop a line back here with the results. I'm curious to see how this resolves now. This is one of those issues you run into every great once in again and for whatever reason I always forget how to fix it.
Was This Post Helpful? 0
  • +
  • -

#5 midasxl  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 191
  • Joined: 03-December 08

Re: Session Management CFID changes on every page

Posted 03 February 2011 - 09:03 AM

I'm thinking this is probably because I didn't have setClientCookies = true in the application.cfc.

Every page refresh or page request was starting a new session because cookies were not being sent and I was not sharing the URLTOKEN between pages.

That's my best guess!

Thanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1