Bakery: Why do I get the "Logging out the user with the bad cookie"? I am attempting a Single Sign On solution using the Bakery module.

My problem is each attempt to login results in the following error:


  Logging out the user with the bad cookie.


Those failing login attempts are to the master site which also means I can't login to the sub-sites.

All the necessary configurations are in place.


The master site is http://www.example.com/
The master site checkbox is enabled
http://sub.example.com/ is input as the slave site
Cookie age is set to 3600
Private key is examplesite
Cookie domain is .examplesite.com
Username and email are my enabled profile fields


I don't get why it's not responding with successful logins.
Please help if you can.
As an alternative to Bakery, if your sites are all co-hosted and you're using MySQL, you can get your sites to share user tables as described by Lullabot.

The important parts are the Master site setup:

$db_url = 'mysql://user:pass@localhost/master_database';
$db_prefix = '';


The shared cookie domain (which you already have):

$cookie_domain = '.example.com';


And the slave site setup:

$db_url = 'mysql://user:pass@localhost/slave_database';
$db_prefix = array(
   'default'   =&gt; 'name_of_slave_database.',
   'users'     =&gt; 'name_of_master_database.',
   'sessions'  =&gt; 'name_of_master_database.',
   'role'      =&gt; 'name_of_master_database.',
   'authmap'   =&gt; 'name_of_master_database.',
);


I have succeeded with this method in the past, though I think I used the normal database array instead of $db_url.