Is it it possible to change the prefix for the Drupal session cookie? For example, I'd like to change it from "SESS" to something like "MYSESS".

It appears this is set in the last line of the function conf_init():

session_name('SESS'. md5($session_name));

See: http://api.drupal.org/api/function/conf_init/5

I'd prefer to change the prefix without editing this function.

The reason for this is that I need an external application to access the cookie and want to make sure that I'm reading the correct cookie as opposed to another application's cookie with the same prefix. "SESS" seems a little too generic for me.

I am open to other ideas or reasons why this might be a bad idea.

Thanks.

Comments

erikwebb’s picture

I've added a patch to D8 to try and resolve this - http://drupal.org/node/1361742

cschults’s picture

Thanks for the heads up Erik. Fortunately, we haven't encountered any problems, but it is nice to know that someone else is addressing this.