Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Secure a folder with sessions - PHP/MySQL

Participant ,
Aug 24, 2009 Aug 24, 2009

I have a member site that I hav erecently developed a download library for. All the downloads (Word docs or PDFs) are stored in one directory and the user must be logged in using a session based system to gain access to the download page (in the directiry above) which contains all the links to the documents.

So non members can't access the downloads page but I'm guesssing that pretty soon each of the PDFs and Word docs will be picked up by google  and non-members will be able to open or download them directly.

Is there a way that I can secure access to the contents of the download folder using sessions?

Or if not any other solution?

Cheers

Dave

TOPICS
Server side applications
592
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 24, 2009 Aug 24, 2009
LATEST

The simple way is to put all of the docs in a folder that you secure using web server security. Most hosting plans these days make this option available from the host control panel. The problem with this is that it is a different security layer than the one you are currently using, and integrating the two , while possible, might be challenging.So you might instead just put all of the documents, including html, into a secured folder and use that security method instead.

Another method to consider is putting all of the sensitive docs in a directory above the site root, and then use server side scripting on a secured page to stream the files. It's relatively simple and you can use a script like this one:

http://www.computerhope.com/issues/ch001113.htm

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines