Home > Article > Backend Development > PHP setting method to put session into memcached_PHP tutorial
When the php.ini file can be modified:
1. Modify
in php.ini
2. It is OK to access the session value normally.
When the php.ini file cannot be modified:
a. Dynamically modify the settings in php.ini.
b. Normal access to the session value is OK.
Comparison between Memcache and Session
The main purpose of memcache is to relieve database pressure and speed up, so it is a kind of stateless data (stateless data: the current data is not bound to a certain user, such as: Lee Richard can take out the stored data, as long as he knows the corresponding key value)
Session data is bound to the user, so it is a stateful data.
Security of Memcache
Put memcache into the intranet and use a firewall to block external access
Suitable for data stored in Memcached
Data that changes frequently, is unstable, does not need to be stored in real time, and has low security