Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

WordPress is installing a PHPSESSID cookie as soon as someone lands on my site. Under new EU law if its non-essential i have to block it so that a user can opt-in. But if it is essential its ok as long as I detail its use on my site. This is the problem.

I look after about 20 WordPress sites and only 2 of them install a PHPSESSID cookie immediately.

I cant see why. Its definitely not caused by any of my more unusual code or any of the plugins as I have stripped it down to its barebones and its still doing it.

I know WordPress is installing it and I assume it's essential (which will mean it's ok according to the new directive) but I still need to detail it on my cookies page.

But I dont know what it is and cant find anything on the web :(

Both of the sites affected don't give the option for login. Whereas a load of the others do and they don't install that cookie so I have no idea what its purpose is.

Can anyone say what this cookie does and why only 2 of my sites are installing it into the browser?

Both use latest version of WP and there is nothing like an ecommerce element in either site.

cheers

James

share|improve this question
    
I cannot find such a cookie on my local WordPress install. By barebones are you sure you went all the way down to a vanilla WordPress install and twentyten theme with no content? Plugins and Core aren't the only things that can set cookies ( the theme could be the culprit, or things like facebook like buttons and google analytics ) –  Tom J Nowell May 24 '12 at 11:10
    
Is the PHP configuration for all of the sites the same? Are they on the same server? –  Joseph May 24 '12 at 12:16
    
Hi sadly i cant go back to twentyten as these are live customer sites. I made the theme so i know it isnt installing anything and i have deactivated all plugins and even removed the search feature in case that was causing it. there is no login area either. These sites are on the same server as several others i have done using same php and wordpress settings. there are no social sharing buttons and analytics has already been tackled and tracked separately. any ideas? –  James Olney May 24 '12 at 13:29
    
Close-voted as too localized. This is an issue with your specific configuration (server, core, Theme, Plugins). I would recommend rebuilding that configuration, using a local or dev server: install core, install/activate Theme, install/activate Plugins, in order to determine where the session cookies are being added. –  Chip Bennett May 24 '12 at 13:57
add comment

1 Answer

up vote 5 down vote accepted

The cookie looks like it is being set by the PHP session handling process. WordPress 'out of the box' doesn't use sessions, which would seem to point towards either your theme or a plugin.

If you search your code base for 'session_start' you may be able to track down where the session is being initiated.

PHP can also be set to auto start sessions. You may also need to check your php.ini file(s) for the 'session.auto_start' property.

share|improve this answer
    
Hi Found it! Ok I was wrong - it was a plugin doing it. I thought I had deactivated that one but maybe I hadn't as its only used on 1 page in a 200 page site. Cforms (the amount of problems that plugin has caused me is unbelievable). It doesn't even need to be called up onscreen (let alone actually used) to install cookies! At least now I know so I can detail it. Thanks everyone for the help :) –  James Olney May 24 '12 at 14:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.