downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Memcached> <Lectura de caché de llamadas de retorno
Last updated: Fri, 20 May 2011

view this page in

Soporte de sesiones

Memcached proporciona un controlador personalizado de sesiones que puede ser usado para guardar sesiones de usuario en memcache. Utiliza una instancia completamente separada para este propósito, así que se puede usar un grupo de servidores diferente si es necesario. Las claves de sesión son guardadas bajo el prefijo memc.sess.key., hay que tenerlo en cuenta si se utiliza el mismo grupo de servidores para sesiones y caché genérico.

session.save_handler string

Defínase como memcached para activar el soporte de sesiones.

session.save_path string

Separado por comas se definen las entradas hostname:port para ser usadas en grupos de servidores de sesiones, por ejemplo "sess1:11211, sess2:11211".



Memcached> <Lectura de caché de llamadas de retorno
Last updated: Fri, 20 May 2011
 
add a note add a note User Contributed Notes Soporte de sesiones
Tobias 17-Feb-2011 03:35
You probably don't want to use Memcache, Memcached or anything else similar for storing sessions (in RAM via memcached daemon server), because those sessions can easily be thrown away/discarded, become unreachable for various reasons, and then your user gets logged out without warning.

What memcache is great for, in general, is storing the results of an SQL or MongoDB query, using the md5() has of the query itself as the key lookup.

For example, for all database queries, get the md5() hash of the query, then look for that key in memcache.  If it's found, great, grab the results, check they're not too old / outdated, and use them if okay.  Otherwise, pass through the query to underlying storage-based DB, then save its results into memcache before passing them back to your app.

This general applicability of how, when, where and why to use memcache to greatest advantage and least pain isn't so easy to find on the web.

Memcached module is great for new features, etc. (except now it's almost one year since update) but it's difficult to tell when a memcached daemon goes away, crashes, becomes unreachable.

Memcache at least has ->connect() method which will report failure/unreachability, but its features are behind.

These two projects are moving targets, competing, and it would be nice to get both together, so we can all benefit from best efforts.  Meanwhile, what a mess, and what a charm!
nfoo at naver dot com 28-Aug-2010 07:15
If you want to use 'memcacheD' extention not 'memcache' (there are two diffrent extentions) for session control,  you should pay attention to modify php.ini

Most web resource from google is based on memcache because It's earlier version than memcacheD. They will say as following

session.save_handler = memcache
session.save_path = "tcp://localhost:11211"

But it's not valid when it comes to memcacheD

you should modify php.ini like that

session.save_handler = memcached
session.save_path = "localhost:11211"

Look, there is no protocol indentifier
Andrei Darashenka 27-May-2009 02:56
This extension supports Session-locking!

by default
MEMC_SESS_LOCK_ATTEMPTS   30
MEMC_SESS_LOCK_WAIT       100000
MEMC_SESS_LOCK_EXPIRATION 30

 
show source | credits | stats | sitemap | contact | advertising | mirror sites