# Protecting a PDF with a session

**URL:** <https://forum.kirupa.com/t/protecting-a-pdf-with-a-session/239383>\
**Category:** programming\
**Created:** [September 21, 2007, 3:21am UTC](https://forum.kirupa.com/t/protecting-a-pdf-with-a-session/239383 "2007-09-21T03:21:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)\
**Post date:** [September 21, 2007, 3:21am UTC](https://forum.kirupa.com/t/protecting-a-pdf-with-a-session/239383/1 "2007-09-21T03:21:54Z")

</div>

I am redoing a site that is using a login and password to even get into the site…It has one of those window prompts that come up and ask for a username and pw before anything happens. What I plan on doing is making a login form in flash which is no problem. Inside the site are a bunch of pdfs. I need a user to be able to download them once they are logged in but ONLY if they have logged in.

I know its possible one way or another to get a direct link to one of the PDFs that will be inside the flash site once the user has logged in.

Is their a way to set a session in flash that when the user clicks to open a pdf, it sendsAndLoads a php file that checks if the session is registered and if its not , continue download. Basically I need a php file that checks for a session and if its registered then continue and let them download. I am doing this just so no random person can just type [http://blahblah.com/files/thepdf.pdf](http://blahblah.com/files/thepdf.pdf)

I hope you understand what im trying to say. Thanks!
