Jump to content
xisto Community
vicky99

How To Delete Files When Session Ends

Recommended Posts

Dear FriendsI need solution to a problem. The problem is as under:I am creating certain files (playlist) in server disk when user selects some songs. The files are created in ram format. What I want to do is to delete these files created during a particular session. Is it possible to do so? Now I am deleting these files using on Unload event fired by JavaScript. I am using PHP.

Share this post


Link to post
Share on other sites

I think it is possible to delete the files before the session is ended by using the unlink() php function, but you need the correct system priviligies to do it.Best regards,

Share this post


Link to post
Share on other sites

Or use a system call?

Yes you are right, it is another solution but many host servers for security reasons disable this functions so you can't use it.

Best regards,

Share this post


Link to post
Share on other sites

Dear FriendsI need solution to a problem. The problem is as under:
I am creating certain files (playlist) in server disk when user selects some songs. The files are created in ram format. What I want to do is to delete these files created during a particular session. Is it possible to do so? Now I am deleting these files using on Unload event fired by JavaScript. I am using PHP.


Hi

I have just learnt how to do it. I think you can use the session_destroy() function. More information can be found at http://sg.php.net/session_destroy

I hope that the website would give you the answer that you are searching for.

Cheers.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.