Jump to content

Session security


meltingpoint

Recommended Posts

I have a flat file database and have a login script that also stores all the users/passwords in flatfile.  Once the user has been verified- I load the username, their access level (allows them to view certain pages) and their user group into $_session variables.  This all works well- no problems.  Passwords are md5 into the database upon registration.

 

My question is security.  My site is on a shared hosting server.  I feel fairly confident that my script won't get hacked (I have the necessary checks for user input etc...) but I worry about the session being hijacked or worse.

 

So..........what do you all say?  Should I capture the IP address and then catch it on each successive page and compare it to the original login IP address?  What steps would you take to shore up some security on a shared hosting environment with out the expense of an SSL?

 

 

 

:shrug:

Link to comment
Share on other sites

Thanks asmith-  will study that page and make appropriate application. 

 

I am a little confused when referring to storing sensitive files outside the document root or public html folder.  Does that mean that you create a directory inside the document root and store sensitive documents/pages there or place them in a directory behind the document root. 

 

For instance;  in the example give in the tutorial- would I store sensitive data in the directory "library" or "modules" or "applications"? 

Link to comment
Share on other sites

No.

 

To say it simple,

When accessing a site url like:

example.com

 

The actually directory we are visiting it normally something like this:

 

/www/index.php

or

/pubilc_html/index.php

 

The www/ or public_html/ is called document root.

 

If a file is stored outside of it, The location would look something like this:

 

/file.ext or /folder/file.ext

nobody can access the outside of your document root.

 

In other words, A folder before the example.com would be ../example.com which no one can access.

Link to comment
Share on other sites

Shared hosting usually does not allow access to anything outside the document root, especially cheaper hosts. Just make sure you bloody use .htaccess to disallow public access to your flatfile db.

 

Your idea of recording the IP and using it as a session variable is an intelligent idea, it's funny nearly no site in existence does this, on gmail, hotmail, if you revert your IP mid-browsing you can still be in.. I'd look into securing that.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.