I'm trying to find a good way to restrict access to a temporary directory that holds a PDF report. The PDF is generated by a script and then redirected to. I found this is the only way to do it b/c I needed the filename to be correct, and some sort of IE bug caused the PDF to be named the same as the script when saved; which was not ok. So, the script creates a temp directory (something like /tmp-pdf098098098098/) and then drops the PDF into it.
The user is already logged in from a MySQL table and has a session storing their information. Is there a good, secure, and easy (I know those don't often go together) way to allow that user to access that file, but no one else.
Any temp directories over an hour old are deleted by the script, so the protection doesn't need to last forever.
Thanks,
- Ryan