When do session files get erased?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ImOk

    When do session files get erased?

    I am using filebased sessions with and they get created in a folder
    called c:\php5apps\ses sions

    I have cookies enabled. I clear the cookies, but when to the session
    files eventually get erased?

    Does PHP check the sessions folder everytime for expired sessions and
    erase them?

    Thanks

  • Alvaro G. Vicario

    #2
    Re: When do session files get erased?

    *** ImOk escribió/wrote (7 Jul 2006 10:45:07 -0700):
    I have cookies enabled. I clear the cookies, but when to the session
    files eventually get erased?
    >
    Does PHP check the sessions folder everytime for expired sessions and
    erase them?
    Not every time, just randomly.

    The behaviour is defined by these directives:

    session.gc_prob ability
    session.gc_divi sor
    session.gc_maxl ifetime

    From manual:

    "session.gc_div isor coupled with session.gc_prob ability defines the
    probability that the gc (garbage collection) process is started on every
    session initialization. The probability is calculated by using
    gc_probability/gc_divisor, e.g. 1/100 means there is a 1% chance that the
    GC process starts on each request. session.gc_divi sor defaults to 100."


    --
    -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
    ++ Mi sitio sobre programación web: http://bits.demogracia.com
    +- Mi web de humor con rayos UVA: http://www.demogracia.com
    --

    Comment

    • ImOk

      #3
      Re: When do session files get erased?

      Weird way of doing it. I guess one can set the probability to 100% to
      do this every time.
      But thanks, I will read about it more in the manual.

      Alvaro G. Vicario wrote:
      *** ImOk escribió/wrote (7 Jul 2006 10:45:07 -0700):
      I have cookies enabled. I clear the cookies, but when to the session
      files eventually get erased?

      Does PHP check the sessions folder everytime for expired sessions and
      erase them?
      >
      Not every time, just randomly.
      >
      The behaviour is defined by these directives:
      >
      session.gc_prob ability
      session.gc_divi sor
      session.gc_maxl ifetime
      >
      From manual:
      >
      "session.gc_div isor coupled with session.gc_prob ability defines the
      probability that the gc (garbage collection) process is started on every
      session initialization. The probability is calculated by using
      gc_probability/gc_divisor, e.g. 1/100 means there is a 1% chance that the
      GC process starts on each request. session.gc_divi sor defaults to 100."
      >
      >
      --
      -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
      ++ Mi sitio sobre programación web: http://bits.demogracia.com
      +- Mi web de humor con rayos UVA: http://www.demogracia.com
      --

      Comment

      • Jerry Stuckle

        #4
        Re: When do session files get erased?

        ImOk wrote:
        Weird way of doing it. I guess one can set the probability to 100% to
        do this every time.
        But thanks, I will read about it more in the manual.
        >
        Alvaro G. Vicario wrote:
        >
        >>*** ImOk escribió/wrote (7 Jul 2006 10:45:07 -0700):
        >>
        >>>I have cookies enabled. I clear the cookies, but when to the session
        >>>files eventually get erased?
        >>>
        >>>Does PHP check the sessions folder everytime for expired sessions and
        >>>erase them?
        >>
        >>Not every time, just randomly.
        >>
        >>The behaviour is defined by these directives:
        >>
        >>session.gc_pr obability
        >>session.gc_di visor
        >>session.gc_ma xlifetime
        >>
        >>From manual:
        >>
        >>"session.gc_d ivisor coupled with session.gc_prob ability defines the
        >>probability that the gc (garbage collection) process is started on every
        >>session initialization. The probability is calculated by using
        >>gc_probabilit y/gc_divisor, e.g. 1/100 means there is a 1% chance that the
        >>GC process starts on each request. session.gc_divi sor defaults to 100."
        >>
        >>
        >>--
        >>-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
        >>++ Mi sitio sobre programación web: http://bits.demogracia.com
        >>+- Mi web de humor con rayos UVA: http://www.demogracia.com
        >>--
        >
        >
        Actually, it makes a lot of sense. The heavier the load, the more often
        the gc runs.


        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        Working...