When I enable memcache-session.inc I get a problem with drupal_set_message()/drupal_get_messages(), which results in messages never being cleared. After a message has been set with drupal_set_message it is shown on all following pages using drupal_get_messages.
When I disable memcache-session.inc this issue disappears and it works as expected.
I have tried to track this down and it seems like the variable holding messages is cleared by unset($_SESSION['messages']) beeing executed, but on the next request the message is back in $_SESSION['messages']).
I am using memcache.inc and memcache-session.inc with the following config and versions:
memcache module for drupal: 6.x-1.1
PECL php memcache: 2.2.4
PHP: 5.2.4
memcached: 1.2.6
$conf = array(
'cache_inc' => './sites/all/modules/memcache/memcache.inc',
'session_inc' => './sites/all/modules/memcache/memcache-session.inc',
'memcache_servers' => array('localhost:11211' => 'default',
'localhost:11212' => 'cluster2'),
'memcache_bins' => array('cache' => 'default',
'cache_page' => 'default',
'session' => 'cluster2',
'users' => 'cluster2')
);
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | memcache-session.inc_.patch | 2.63 KB | jeremy |
| #4 | mcsessionclearing2jv.patch | 3.22 KB | jvandyk |
| #3 | mcsessionclearingjv.patch | 3.17 KB | jvandyk |
Comments
Comment #1
andreiashu commentedconfirmed. same happens here. (fresh D6.8 - D6.9 install)
Comment #2
mmcdougall commentedSee http://drupal.org/node/363651 . Try my fix by commenting out the second "if" statement in sess_write() like this:
Good luck, Marc
Comment #3
jvandyk commentedHere is a patch based on Marc's observations.
Comment #4
jvandyk commentedAnd it occurs to me that it is cleanest to unset the session_data_present_at_load flag from $user prior to storage as well.
Comment #5
andreiashu commentedApplied the patch from #4. Everything seems to be working fine: drupal messages are being cleared and everything else works as expected.
Comment #6
jvandyk commentedCommitted. Fixed in 6.x-1.2 and later.
Comment #7
andreiashu commentedthanks !
Comment #8
jeremy commentedThis fix needs to be backported to 5.x-1.x-dev.
Comment #9
jeremy commentedHere is a first attempt at a backport. Testers welcome!
Comment #10
catchJust marked 5.x as unsupported, so won't fixing this.