Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

A note on WordPress and cookie integration problems

ZiyphrZiyphr New
edited February 2007 in Vanilla 1.0 Help
The WordPress integration tutorial is generally excellent and has been a great help. I'm sure many will have adopted Vanilla as a result. Don't worry about this unless you are experiencing trouble sharing a cookie across multiple directories.. I got everything working with the forum directory inside the blog, i.e. /blog/forum/ but I didn't want this for various reasons. When I moved the forum directory up to the same level as blog Vanilla wouldn't see the cookie, even though WordPress would. Changing the cookie path settings didn't seem to fix anything, perhaps because we created a custom authenticator. To fix this I did 3 things: 1) Changed lines 184 and 185 in People.Class.WordpressAuthenticator.php to $this->CookiePath = '/'; $this->SiteCookiePath = '/' ; 2) Comment out lines 34-37 in People.Class.WordpressAuthenticator.php to prevent error message on login. 3) I installed a simple plugin for WordPress that makes WP use a root cookie: I hope other developers will find this useful.


  • Ziyphr, I followed your directions here to fix the login errors, but I still can not login to wordpress after I login to the forum. Any ohter suggestions? Thanks
  • ZiyphrZiyphr New
    edited February 2007

    The other day I upgraded WordPress and ran into some login problems. To fix these I loaded up wpsettings.php (in WP root) and found line 185.

    if ( !defined('COOKIEPATH') ) define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );

    if ( !defined('COOKIEPATH') ) define('COOKIEPATH', '/' );

    This should solve problems when logging in via WP, but my original post should fix problems when logging into Vanilla first. It's quite confusing but with cookies I've found most are getting defined to only work in a specific folder rather than your webroot. This is what both my changes fix.
  • Or you could fix the bug in People.Class.WordpressAuthenticator.php, line 34.

    if ($CookiePath != $SiteCookiePath ) {

    if ($this->CookiePath != $this->SiteCookiePath ) {

    Not certain this fixes your problem but it couldn't hurt.
This discussion has been closed.