search

Home  >  Q&A  >  body text

Will laravel's files not be automatically deleted after the session expires?

I tried it locally and found that the files in storage\framework\sessions will not be automatically deleted after the session expires?

伊谢尔伦伊谢尔伦2782 days ago591

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-05-16 16:58:00

    It will be covered, look what I found

    https://github.com/laravel/framework/blob/5.1/src/Illuminate/Session/M...

    // Here we will see if this request hits the garbage collection
    lottery by hitting // the odds needed to perform garbage collection on
    any given request. If we do // hit it, we'll call this handler to let
    it delete all the expired sessions.

    https://github.com/laravel/framework/blob/a423a55ed6601daebcbb75817de6...

    The

    gc method should destroy all session data older than the given $lifetime UNIX timestamp.

    http://laravel-china.org/docs/5.0/extending
    https://github.com/laravel/framework/blob/5925ed9bae03c86ea0d6902568ca...
    https://github.com/laravel/framework/blob/ a423a55ed6601daebcbb75817de6...

    reply
    0
  • 怪我咯

    怪我咯2017-05-16 16:58:00

    You can set the session file storage directory to /tmp,配置项为config/session.phpfiles

    reply
    0
  • Cancelreply