What can cause a session to end?

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. #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...
    2. #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: ...
    3. #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: ...
    4. #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...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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.
    >...As it turned out, none of them pertained in this situation
    Most of the points do, in fact, pertain to your situation. Two different URLs
    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

  6. #5

    Default Re: What can cause a session to end?

    Pease read "in" for "is"
    BKBK Guest

  7. #6

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139