7 Replies Latest reply on Jun 28, 2006 12:26 PM by Jwahl

    session/ application timeouts

    Jwahl
      Is anyone aware of an application or session variable problem using virtual directoies in IIS win2003
      I have 10 portals(/p1,p2,p3,p4...Pn) that share a main Directory (MD) as a virtual directory.
      it looks like this to the world;
      example.com/P1/md
      P1 has an application.cfm
      MD's application.cfm looks like this:

      <cfset ds=ucase(listgetat(cgi.PATH_INFO,1,"/"))>
      <CFAPPLICATION NAME="#ds#" CLIENTMANAGEMENT="Yes" SESSIONMANAGEMENT="Yes" SETCLIENTCOOKIES="Yes"
      sessiontimeout="#CreateTimeSpan(20,0,0,0)#">

      where PATH_INFO=/P1/MD/index.cfm

      Anybody see a problem with this?
      I need the application vars and session vars to last 20 days.
      the server max is 35 days and the min is 10 days.
      It seems that they hold for maybe 2 days. Is it my code or a virtual directory thing?

      ~J
        • 1. session/ application timeouts
          BKBK Adobe Community Professional & MVP
          When you specify sessiontimeout="#CreateTimeSpan(20,0,0,0)#" you imply that, when a visitor opens a page on your site and goes away, he may resume the session when he returns 20 days later. Is that what your intention is?

          The attributes, applicationtimeout and sessiontimeout, are not specifications to determine how long application and session vars will live. They are, respectively, the time after which Coldfusion will time the application or session out, if it has been inactive. That is why the default sessiontimeout value is usually 20 minutes and the default applicationtimeout 2 days. With sessiontimeout="#CreateTimeSpan(0,0,30,0)#", the user's session can last for 20 days, or 20 months or 20 years for that matter, so long as there is never a gap of more than 30 minutes when he doesn't interact with the application.

          The maximum values of applicationtimeout and sessiontimeout that are allowed in cfapplication tags are set in the Coldfusion Administrator. The default is 2 days(for applicationtimeout as well as for sessiontimeout). If the value you set in cfapplication is higher, you will not get an error. Coldfusion will just use the Administrator's maximum value. That is likely why your sessions held for 2 days rather than 20 days.




          • 2. Re: session/ application timeouts
            JaredJBlackburn
            The CF server has a max timeout setting that limits what you can set in the <cfapplication> tag. In order to increase the timeout period, you would have to change that too.
            • 3. session/ application timeouts
              Jwahl Level 1
              Thanks Guys
              Yes: I need the application vars and session vars to last 20 days.
              Yes: the server admin max is 35 days and the min(default) is 10 days.
              So I would assume that these would stick around for 20 days. It worked fine before I switched to virtual directories in our CMS.
              I do have an application tag in the share which should grab the apps name so the share knows which app to be for any one user.
              I was wondering if there was a known issue with session/application variables and virtual directories.

              ~J
              • 4. Re: session/ application timeouts
                BKBK Adobe Community Professional & MVP
                the server admin max is 35 days
                What do you mean by that? What values have you set in the Coldfusion Administrator for:

                a) the maximum values of applicationtimeout and sessiontimeout;
                b) the default values of applicationtimeout and sessiontimeout?

                • 5. Re: session/ application timeouts
                  Jwahl Level 1
                  Cut & Pasted from the CF Admin:

                  Enable Application Variable:checked
                  Enable Session Variables; checked

                  Maximum Timeout
                  Application Variables 35 days 0hours 5mins 0secs
                  Session Variables 35d ays 0hours 5mins 0secs


                  These values specify the time-out period that ColdFusion MX uses if you do not specify an application-specific value in the cfapplication tag.

                  Default Timeout
                  Application Variables 10 days 0hours 5mins 0secs
                  Session Variables 10 days 0hours 5mins 0secs

                  Hope that makes it clearer..

                  Thanks for your patience!

                  ~J
                  • 6. Re: session/ application timeouts
                    BKBK Adobe Community Professional & MVP
                    Put both the sessiontimeout attribute and the applicationtimeout attribute in the cfapplication tag. Give applicationtimeout a value greater than that of sessiontimeout.

                    • 7. Re: session/ application timeouts
                      Jwahl Level 1
                      BKBK,
                      Putting both the sessiontimeout and the applicationtimeout in the application cfm seemed to have done it. 5 days later and still had my sessions sticking until they disappeared again.

                      Eventually found out that my Hosting Co. has been applying patches and rebooting the Server at night/early morning.

                      so, I think we are good to go now. I'll have to keep an eye on my sessions and my host!

                      Jeff