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

session time out

Status
Not open for further replies.

KSiva

Programmer
Feb 18, 2002
63
AU
Hi all,

We are running coldfusion4.5 and it's been pretty good with session management. Suddenly, we started having problem in losing the session variables. I increased the time to 2 hours, and some times session expires in 10 mins. We never experienced this problem before but now. Has any one faced this problem and got it fixed?

I have also tried using cflock but still the same. Does javascript do anything on session, ( i wont imagine so ). Just thought because I am using a lot of JavaScript on this site.... any help please.


Sivakumar Kandaraj :)
System Administrator,Web Programmer
Melbourne
Australia.
 
I'm not sure if this will help (or if you've already tried it), but if you change the session timeout in the CF Administrator, you have to stop/start ColdFusion services on the server before the new settings will take affect.

I don't know what could be causing the sudden change, have made any changes to the site recently?

Hope this helps!
 
Did you happen to recently create a Application.cfm with a hard coded session timeout that might be affecting the whole site (or at least the sections that you're noticing the problem in)? Like... in a root directory?



-Carl
 
Hi all,

Thanks for writing. But like I said, I have increased the session time out and it's still happening. Session times out only occassionly, not often. I forgot to tell you guys one more thing. Specially this happens when people goes other login page in the same server, which uses different application.cfm, they have been logged out in the previous session. It's strange because we never had this problem in past 3 years.

Any help on this?

Siva

Sivakumar Kandaraj :)
System Administrator,Web Programmer
Melbourne
Australia.
 
So what's the session timeout set for in the Application.cfm for the login page? And where is this Application.cfm in relation to the other(s)?



-Carl
 
Timeout time set for 90mins
sessiontimeout="#CreateTimeSpan(0,1,30,0)#">

and application.cfm are different for each intranet folders.

And also I just notice one more problem!
I login to the site,
and when I go to it says page not found. But when went back to and log out myself, and tried page, it works.

>?? It does not make any sense to me. Does it to you?

Siva

Sivakumar Kandaraj :)
System Administrator,Web Programmer
Melbourne
Australia.
 
One thing you may want to try is naming the <cfapplication> tag the same thing in both application.cfm files. This isn't recommended, but (for testing) it should allow you to pass the session variables from 1 application.cfm to another.

 
Two different application.cfm files with different application names will have separate sessions. Session variables set when you are under application &quot;foo&quot; won't be available when you are under application &quot;bar&quot;. This has always been the case back to 4.0, at least.

If you want users to be able to &quot;cross over&quot; to another app, the application name in that app must be the same, otherwise you won't have any of the session variables attached to the new app. This is obviously by design. Just think about it for a second: In a shared hosting environment, if everyone had the same session variables not matter what the application name was, there would be chaos!

-Tek
 
Chaos, I tell ya'! [rednose]

It's unfortunate that CF named the scope &quot;session&quot;... because us web developers tend to think of a session as &quot;any period of time during which a single browser instance is in use&quot;... which would tend to lead you to believe CF session variables are persistant as long as that instance of the browser was alive (even across applications). But, as Tek points out, that would actually be undesirable in the real world (otherwise a user could go from one CF-hosted domain to another, and the session variables from the first would follow him/her... making life very difficult for the second site).

Think of the CF &quot;session&quot; scope as actually &quot;the user's instance of a particular web application&quot;.

The only way to share variables between differently-named CF applications is via cookies (possible because they're domain-specific) or, of course, URL/FORM scopes.





-Carl
 
I had the same problem with my sessions timing out within a few minutes. I tested with many variations of application names and both the cookie and non-cookie session management, but still had the same problem on our development server. The same code worked fine on the production server.

The only consolation I can offer is that upgrading to MX seems to have resolved the issue for us. Also, MX supports J2EE Java sessions which act as expected and expire when the brower closes.

Dave
 
One thing I've found that resolves sessions timing out is to make sure you set the sessiontimeout and the applicationtimeout. If you leave one or the other out it sometimes seems to cause problems with the session intermittently timing out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top