The option $_SESSION is fantastic for security but I'm not sure how to apply this to release mySQL connection after a predefined period of time, especially if there is no user activity. From what I can gather the $_SESSION (as demonstrated in ) does not release mysql resources until the user tries to do something. Can someone please advise me here.