Session end

Reply

Join Date: Sep 2004
Posts: 3
Reputation: bratbo is an unknown quantity at this point 
Solved Threads: 0
bratbo bratbo is offline Offline
Newbie Poster

Session end

 
0
  #1
Oct 20th, 2004
Is there any way to ensure that a particular code is executed when a session ends e.g to remove temporary files og database entries ? similar to the Session_OnEnd in the global.asa file in an asp application ?
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 3
Reputation: Shorty is an unknown quantity at this point 
Solved Threads: 0
Shorty Shorty is offline Offline
Newbie Poster

Re: Session end

 
0
  #2
Oct 21st, 2004
That depends on what session method you are using. Are you using standard file based sessions or have you written a session handler that uses MySQL?

(assuming I have understood your question correctly).
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 3
Reputation: bratbo is an unknown quantity at this point 
Solved Threads: 0
bratbo bratbo is offline Offline
Newbie Poster

Re: Session end

 
0
  #3
Oct 21st, 2004
Originally Posted by Shorty
That depends on what session method you are using. Are you using standard file based sessions or have you written a session handler that uses MySQL?

(assuming I have understood your question correctly).
I am thinking i terms of standard php sessions (cookie og querystring based)
Regards
Martin Bratbo
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 2
Reputation: melban is an unknown quantity at this point 
Solved Threads: 0
melban melban is offline Offline
Newbie Poster

Re: Session end

 
0
  #4
Mar 29th, 2006
Did you ever get this figured out. I would also like to delete temp files that are associated with a specific session if that session has ended.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 355
Reputation: DanceInstructor is an unknown quantity at this point 
Solved Threads: 14
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: Session end

 
0
  #5
Mar 29th, 2006
If I'm not mistaken PHP automatically handles garbage collection and cleanup when a session ends. That is provided you haven't declared any custom session handlers using session_set_save_handler().
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 2
Reputation: melban is an unknown quantity at this point 
Solved Threads: 0
melban melban is offline Offline
Newbie Poster

Re: Session end

 
0
  #6
Mar 29th, 2006
PHP does handle it's own garbage colleciton. What I was getting at was the ability to save uploaded files to a custom temp directory (not php tmp) but delete those files when the session was destroyed.

I'm getting around this buy actually loading the file contents into the session. makes for a large session file but that is the only problem i've had so far.

Originally Posted by DanceInstructor
If I'm not mistaken PHP automatically handles garbage collection and cleanup when a session ends. That is provided you haven't declared any custom session handlers using session_set_save_handler().
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 355
Reputation: DanceInstructor is an unknown quantity at this point 
Solved Threads: 14
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: Session end

 
0
  #7
Mar 29th, 2006
That's interesting
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 124
Reputation: thewebhostingdi has a little shameless behaviour in the past 
Solved Threads: 11
thewebhostingdi thewebhostingdi is offline Offline
Junior Poster

Re: Session end

 
0
  #8
Aug 17th, 2009
I think there is no direct way in PHP. This can be done using Global.aspx file in asp.net.

For PHP work around, we can keep the list of created sessiond and then checking for the each sessions if they are available. If any session is found destroyed, we can delete the uploaded files by that session. However, this adds additional efforts managing the session tables along with the list of uploaded files per session.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC