title: Can I restrict web folder access to only logged in users of my website?
body: <p>My website users login using accounts they setup in my website.</p>
  
  <p>I of course store their <em>login info</em> in a <code>db table</code> and this table is accessed when they fill out the login form. This is just a proprietary system I created. </p>
  
  <p>When users are <em>logged in</em>, they can see a list of documents that are stored in a folder on my website. If they are not logged in, they don't have access to this list. However, if someone knows the direct URL of one of the documents, they can download it without logging in. I want to restrict access to this folder to only logged-in users.</p>
  
  <p>I guess I could put a <code>password</code> on the folder itself, but I don't want users to have to enter a password twice. How can I detect if the user is logged in and restrict access to only a <em>logged in user</em>?</p>
  
  <p>Forgive me if this question sounds basic, but I come from the world of IIS and I'm not sure how to do this using a PHP web server.</p>
  
  <p><a href="https://stackoverflow.com/questions/5001737/restrict-access-to-a-specified-folder">This is basically the same question</a>
  , although I'm not using <code>asp.net or IIS</code>.</p>