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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Variables timing out

Status
Not open for further replies.

aliciela

Programmer
Apr 10, 2001
2
CA
We currently upgraded our coldfusion server from 4.0 to 4.5.1. We have session variables set in code using the CFApplication tag to timeout after 8 hours, and on the server we have set the Maximum timeout to 8 hours and the Default Timeout to 8 hours. Our problem is that our web applications are still timing out after 20 minutes even though we do not have 20 minutes set anywhere in our code or on the server. We have stopped and restarted the coldfusion service and that didn't work. Now we're going to remove the cfapplication tag and let the server handle the session timeouts.

Does anyone have any idea why a session would timeout earlier than the times specified?

 
If you have another application on the server that someone else is using, they could possibly be using the same application name and be setting conflicting session timeouts. If you set the default and maximum session timeouts in the admin to 8 hours, there should be no reason why your sessions timeout earlier if you have the <cfapplication> set correctly. If you'll post the code for your <cfapplication> tag, I'll take a look and see if I see anything wrong.

Just remember that if a <cfapplication> tag executes anywhere on the server with the same application name, it will change your session timeouts.

Good luck,
GJ
 
Thank you for the suggestion, I will do a search on our sites for any CFApplications with the same name. We we're running out of ideas. Here is the CFApplication tag you requested.

<CFAPPLICATION NAME=&quot;CallCenter&quot; CLIENTMANAGEMENT=&quot;Yes&quot; SESSIONMANAGEMENT=&quot;Yes&quot; SETCLIENTCOOKIES=&quot;Yes&quot; SESSIONTIMEOUT=&quot;#CreateTimeSpan(0,8,0,0)#&quot; APPLICATIONTIMEOUT=&quot;#CreateTimeSpan(1,0,0,0)#&quot;>
 
Hi aliciela,

I don't see anything wrong with your code and I copied/pasted it into a test file and found that the session variables didn't time out at 20 minutes. If you've eliminated the possibility of conflicting applications and you're absolutely positive the CF admin is configured correctly, my next area of investigation would be the code.

I would create a test page in the application and try this:

<cfif not isdefined(&quot;session.testVar&quot;)>
<cfset session.testVar = &quot;yes&quot;>
New Session Created
<cfelse>
Session Exists
</cfif>

Run this page once. You should then see &quot;New Session Created&quot;. Don't click on any other page in the site from that web browser or other windows opened by that browser. Just let it sit for 20+ minutes and then reload the page. If the session has truly expired at 20 minutes, you should see the &quot;New Session Created&quot; message again. If there is a problem elsewhere in the code, you should see &quot;Session Exists&quot; for up to 8 hours after your last click on the site. If this is the case, I would look for something in the code that's expiring the session, deleting session varaibles, etc...

Two other possibilities I can think of but would expect to be extreme cases would be
1. A scheduled task is running every 20 minutes and doing some type of clean up
2. The CF service is somehow being restarted every 20 minutes for stability reasons. You could create a server.timeUp variable and set it to the current time to verify this isn't happenning.

Hope this helps,
GJ

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top