Find out if a session with a particular id has expired

后端 未结 3 422
独厮守ぢ
独厮守ぢ 2021-01-28 09:13

I am creating an upload feature that stores a user uploaded file on the server with the user\'s session-id as its name. Now, I want to keep this file on the server only till tha

3条回答
  •  情话喂你
    2021-01-28 09:36

    Intervals can be made like this - someone opens your web -> php script is running -> it checks if files is time-outed -> delete time-oted files

    And no CRON needed :-)

    It is nearly impossible to determinate due to lack of information if user closed or not the browser window ( if he don't closes it but turn sleep mode on and come back in 2 days - session is still active AFAIK ) - only idea to slove this problem in best manner this is to use own session engine with AJAX checking.

提交回复
热议问题