Jump to content

Where is the safest place to store session id's on shared hosting


Recommended Posts

Hi, quick question.  I have recently changed the save path of my sessions on the coding level to be one level above the root directory of my domain.  I am on shared hosting and thought I read it was a bit of a security problem as anyone on your host can have access to the session id's.  Was this the right thing to do to change the save path?  Is it safer?  Are my sessions safe in that location and is there any way they can be accessed?
Well they are but a matching file is saved on the host's server in a temporary directory that is common to all websites that use that host.  I wanted to change it to a private directory that only I could access, but am not sure if it is secure, even though it is one level above my domain directory.  Anybody know?
If you are on a shared host then I would save the sessions to a private directory in your webspace. The best place would be outside of your web root (the web root is the directory in which you upload you files to). That way it is inaccessable from people browsing your website. Only you can read that directory (via FTP).
I think the bigger problem is that through scripts or CGI a different user on the system could access someones sessions.
As far as I know the most secure way would be to handle all the session calls through MySQL using session handler functions.
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.