Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
PleaseHelp #1
What can cause a session to end?
What can cause a session to end? Mi sessions are ending without a timeout or
the browser being closed.
I haven't analyzed the situation fully, but I've definitely established that
it's happening, in predictable ways. And it's causing me grief. I've got
somebody logged in with a session variable, and when they go from page A to
page B the session ends. However, if they are NOT logged in, going from page A
to page B does NOT end the session. Both pages are on the same site.
There is only one Application.cfm on the site, and it's in the root directory.
Sometimes, the effect is computer dependent. My client sees it, but I don't,
so I have to keep him on the phone doing diagnostics -- the Exectutive Director
of an Association!.
I'm doing a bunch of complex things on these pages, so it's hard to know what
to look for. Really, I need a complete list of everything, no matter how
obscure, that might cause a session to end.
Ary help out there?
Thanks!
PleaseHelp Guest
-
#16263 [Com]: session.start() create new empty session file and not resume existing session
ID: 16263 Comment by: pat at burnttech dot com Reported By: kur at natur dot cuni dot cz Status: No Feedback... -
How can I "know" the difference between a session timed out and a session that did session.abort?
Any clues? Thanks for your time. Adam -
#25307 [Ver->Csd]: Crash when session.serialize_handler=wddx & session, post, get vars
ID: 25307 Updated by: sniper@php.net Reported By: cristea at pntcd dot ro -Status: Verified +Status: ... -
#25307 [Ver]: Crash when session.serialize_handler=wddx & session, post, get vars
ID: 25307 User updated by: cristea at pntcd dot ro Reported By: cristea at pntcd dot ro Status: Verified Bug Type: ... -
#25307 [NEW]: Crash when session.serialize_handler=wddx & session, post, get vars
From: cristea at pntcd dot ro Operating system: any PHP version: 4CVS-2003-08-29 (stable) PHP Bug Type: Session related Bug... -
BKBK #2
Re: What can cause a session to end?
1) In the cfapplication tag in your Application.cfm page, set
the SessionManagement attribute to "yes".
2) Also make sure the sessiontimeout attribute is set to a reasonable
value, like 20 minutes, e.g.
sessionTimeout="#createTimeSpan(0,0,20,0)#"
3) If you're using MX6.1 or above, set the loginStorage attribute
to "session". The server will then hold the user's login credentials
in the session scope
4) Check all the code within your cflogin tag carefully. Make sure you
log the user in correctly, using the cfloginuser tag
5) Put all code involving session variables within locks. When you
set a variable, use the exclusive lock, e.g.
<cflock scope="session" type="Exclusive" timeout="10">
<cfset session.var_1 = "x">
</cflock>
When you only read a session variable, use the readonly lock, e.g.
<cflock scope="session" type="ReadOnly" timeout="7">
<cfset y = session.var_2>
</cflock>
6) Make sure the session identifying variables, session.CFID and
session.CFToken, are being passed from page to page. One way to do
this is by appending session.URLToken, e.g.
<a href="pageOnYourSite.cfm?#session.URLToken#">Click </a>
BKBK Guest
-
PleaseHelp #3
Re: What can cause a session to end?
Thank you very much, BKBK, for this extensive list of precautions to ensure a
session is broken.
As it turned out, none of them pertained in this situation. The reason only
the client could see the problem is that he was going to the site with "www."
in the URL, and I was not. There were two pages that caused problems for him
(but not for me). One could only be reached with an absolute link that forced
a non-www URL. The other was a page that didn't recognize his login if it was
created on a www page and forced a new login.
Any ideas on what www's vs. non-www's have to do with session continuity? Any
ideas on why a login on one page would not recognize a login created from a www
URL?
(Note: I am not using CFLOGIN, but rather my own login system which uses a
session variable.)
Thanks!
PleaseHelp Guest
-
BKBK #4
Re: What can cause a session to end?
>... extensive list of precautions to ensure a session is broken.
My intention was an extensive list of precautions to ensure a session is
maintained.
Most of the points do, in fact, pertain to your situation. Two different URLs>...As it turned out, none of them pertained in this situation
may
actually mean two different servers. Everything said above applies to each
server.
The concept of user sessions applies to a single server. Otherwise, it is
meaningless to talk about a difference is session behaviour between you
and the client. You might perhaps want to consider "sticky" sessions, or even
client variables. Take a look at this intro
[url]http://livedocs.macromedia.com/coldfusion/6/Developing_ColdFusion_MX_Application[/url]
s_with_CFML/sharedVars3.htm
BKBK Guest
-
-
PleaseHelp #6
Re: What can cause a session to end?
Thanks again, BKBK. WWW's may have seemed too basic to mention the first time
as a cause of session problems, but I didn't know www/non-www were on different
servers and it just never entered my head -- at least for the first 20 or 30
hours of wrestling with this -- that www's could be the problem.
So simple...when you know.
Thanks!
PleaseHelp Guest



Reply With Quote

