Skip to main content
Participant
September 18, 2013
Question

Session Variables Reset

  • September 18, 2013
  • 1 reply
  • 875 views

Hi Everyone!

We have been having issues with session variables being dropped/changed. Basically what is happening is a user submits a web form and the session variable is changed. We also have problems on other pages where a user will enter their username and password, but once page navigates to the next page or even within the same page when a form is submitted, session variables gets reset. We noticed CFID and Token is different when we navigate or page gets refreshed. I have checked session management settings all over and don't think that's the problem. I have searched and found similar issues but none of the proposed fixes have seemed to work for us. I should also say this problem does not occur for every user. It seems intermittent which adds to the fun... 

 

Our pages all worked fine under Windows 2003 and CF8. We built new W2k8 servers with CF10, moved our files over and set up the new sites so it can’t be left over isapi connectors in IIS. Here is the problem in a nutshell with some code:

After authentication,

  1. Session.UserID is set with a value.

<cfset Session.UserID =”loggedinUser”> 

  1. Session.UserID is BLANK when form is submitted, because refreshing the page changes CFID and TOKEN value. It thinks it’s a new session.

<cfif IsDefined(“form.saveForm”) AND Session.UserID NEQ “”>

Some Query Goes Here….

But can’t get to here because Session.UserID is EMPTY </cfif>

<form action=”?” method=”post”>

<input type="submit" value=" Save Changes " name=”saveForm”> </form>

Any ideas on things to try would be greatly appreciated!

Thanks!

Jonathan

This topic has been closed for replies.

1 reply

Legend
September 19, 2013

Sounds similar to our problem when moving between http and https pages, which is when we lose our session in the same way. The CFID and CFTOKEN should stay constant, so that's correct behaviour. Do you have SetClientCookies set to yes in your <cfapplication> tag?

morrisjjAuthor
Participant
September 19, 2013

Hello and thanks for your reply.

Our pages stay on https through this process and we don't have SetClientCookies in the <cfapplication> tag. 

Yeah you are correct the CFID and CFTOKEN should stay the same, but the problem is they don't for us, they change between pages.

Were you able to find a solution to your problem?

Legend
September 19, 2013

Try enabling the setClientcooklies and see what that brings. We didn't solve our issue unfortunately, and not sure where to look to begin to try and solve it.