title: How to protect against direct access to images?
body: <p>I would like to create a web site with many images. But I would like to protect against direct access to images, e.g. direct links to images without visiting the web site.</p>
  
  <p>What is the preferred way to do this? And what are the alternatives with Pros and cons?</p>
  
  <p>I have some ideas (I don't know if they are possible):</p>
  
  <ul>
  <li>File permissions </li>
  <li>PHP Sessions</li>
  <li>Temporary file names or URLs</li>
  <li>HTTP Redirection?</li>
  </ul>
  
  <p>Maybe this isn't practiced on many web sites? E.g. I tried to access a private photo on Facebook without beeing logged in, but I could still visit the photo.</p>
  
  <p>The platform will probably be a Ubuntu machine with NginX and PHP.</p>