Memecached Storing session data

Source: Internet
Author: User
Tags php memcached

Memcached Storing session

1. Session data needs to be called frequently.

2, session data does not need to be permanently saved on the server.

3, in the cluster, the session can be stored in the memcached or in the database, you can do the user login stored in a server problem. Implementing session Sharing

Implementation session stored in memcached

1, when compiling php memcached extension, the internal implementation of a session processor, Session.save_handler

<?php    ini_set (' Session.save_handler ', ' memcache ');  The processor configured for the session is memcached Ini_set (' Session.save_path ', ' tcp://127.0.0.1:11211;tcp://127.0.0.1:11212 '); You can specify multiple addresses for the memcached that hold the session.  Memcached Cluster to store session session_start (); The following is the normal operation session//NOTE: If you use the Telnet client to see the value of the session, the Memcached key is session_id (); >

  

Memecached Storing session data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.