title: (PHP) How can i protect a directory (and its files) using sessions
body: <p>I'm working on a project, where each user has a folder where he uploads his files.
  The problem: Any user can simply type the path and filename to download.
  Is there any way to protect this using sessions, which is how the system has the code of who is logged in?</p>
  
  <p>  (remembering that each folder has the code of its user, example: user_1, user_2 etc).</p>
  
  <p>It may be useful to protect the file itself.</p>