Jump to content

COOKIES Vs. sessions stored on server.


vicodin

Recommended Posts

Hello all, im in the process of making a site and i plan to have thousands of users at once (dont we all) and the server is a shared server. I dont want any session clashes and i was wondering what would be the best way to prevent this. Should i go cookie or stored session. Also what would be the best way to create a unique session id so i can guarentee against session clashes. Thank you for your time.

Link to comment
https://forums.phpfreaks.com/topic/131870-cookies-vs-sessions-stored-on-server/
Share on other sites

"Session clashes" are not something to be concerned about.  The server automatically does that for you.  The concern about sessions on shared servers is security: that is, poorly setup servers allowing other people on your shared server to gain access to your IDs.

On a shared web server, you need to set session.save_path to be to a "private" folder that is within your account's folder structure. Ideally this should be a folder that is outside of your document root (closer to the disk root) so that no one that guesses its' name can browse to the files or if you cannot create your own folders outside of your document root folder and you must place the folder in your document root folder, then you need to put a .htaccess file in it that denies all http/https requests.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.