cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 1.7.0.2 and Memcached sessions

Magento 1.7.0.2 and Memcached sessions

I have changed the session storage from Database to Memcached on Magento 1.7.0.2. The configuration was pretty straightforward as I added the below line to /app/etc/local.xml file:

<session_save><![CDATA[memcache]]></session_save>
<session_save_path>
  <![CDATA[tcp://127.0.0.1:11211?persistent=1&weight=2&timeout=10&retry_interval=10]]>
</session_save_path>

Although, I got rid of 200MB which was the size of the core_session database table, I can't say that I noticed significant gain on performance. In addition, I noticed that Memcached didn't respect the Cookie Lifetime=43200 I have set at System > Configuration > Web > Session Cookie Management. Indeed, the sessions expired less than 2 hours for the front-end. The same situation was for the back-end as the setting System > Configuration > Admin > Security > Session Lifetime (seconds) = 14400 was not respected either.

 

From phpinfo(), I noticed that both PHP and Memcached have their own directives for sessions. Is there any chance that when Magento stores sessions at Memcached, these directives take effect over Magento settings for sessions?