search

Home  >  Q&A  >  body text

Is the session destruction mechanism in PHP asynchronous?

According to the default configuration, the session in PHP will enter the destruction process of expired session files after 24 minutes and a probability of 1/1000 is triggered. Will this process be synchronized with the request processing process? Or will an asynchronous process be started? If it is the former, won't it block the execution of this request?

漂亮男人漂亮男人2830 days ago426

reply all(2)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-16 13:13:23

    It is not asynchronous and will indeed block the user request, so it needs probability to start.

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 13:13:23

    It’s not asynchronous. Every time PHP accepts a request, there is a certain probability to clean up the expired session. This probability is controlled by these parameters

    session.gc_probability = 1
    session.gc_pisor = 1000
    session.gc_maxlifetime = 1440

    reply
    0
  • Cancelreply