Changing the Session Save Path

From OCS Support Wiki

Jump to: navigation, search

[edit] Introduction

You can change the session save path to a custom location for greater security in your web application with PHP.

[edit] Method

If you don't have one already, create an .htaccess file and add this content to it:

php_value session.save_path "/home/you/session_path/" 

In the above example, replace you with your FTP/SSH/cPanel username and session_path with the path that you want to save sessions in. We STRONGLY recommend it be outside the public_html folder. If you want to use the example above which will work in most cases, create a folder called session_path in your home directory (not the public_html folder). Make sure the folder has 777 permissions so Apache can write to it.