Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename session cookie to something else, than PHPSESSID

I am reading through the suggested php.ini changes from https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess

One of the suggestions is:

# Rename session cookie to something else, than PHPSESSID
php_value session.name sid

I am interested to know how this could effect my current websites and how this would improve security?

like image 988
John Magnolia Avatar asked Dec 20 '25 05:12

John Magnolia


2 Answers

By changing the name, the only security improvement you will have is that you will no longer expose that you are using PHP via the cookie name.

If you change this value, the only side effect on your website is that all the currently logged-in users will became logged-out.

Plus, you can use a fun name, like we_are_hiring_ninjas!

like image 111
Damien Avatar answered Dec 22 '25 20:12

Damien


The name of the session cookie can be changed from the php.ini file and also from the host definition on Apache config.

Take a look there.

All the best.

like image 23
devanand Avatar answered Dec 22 '25 20:12

devanand



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!