I have a html.php page that creates a server side file containing user specific html data that is either printed or emailed when the user clicks on a html button to print or email.
The problem is that there is nothing to stop another user from overwriting the file before the previous user gets a chance to print or email the html file data.
I need to attach some sort of unique session id to the file name so users around the world don't overwrite other users html data files.
I understand that browsers create a unique session id for each user. I have searched for info on the subject but i'm still a little confused on what to use and where to get it.
1. How do i access that id in php so i can attach it to the file name?
2. Maybe a better question is... what kind of ID (IP address, browser session ID,...) is better to use as a session ID?