This is an accidental loss. for example, the $ _ session I read in 2nd ajax requests is an empty array, and the $ _ SESSION value is normal for 3rd requests, however, when I initiate five or six requests at the same time on a page, it is very likely that a session will be lost. how can I solve this problem... this is an accidental loss. for example, the $ _ session I read in 2nd ajax requests is an empty array, and the $ _ SESSION value is normal for 3rd requests, however, when I initiate five or six requests at the same time on a page, it is very likely that a session will be lost. how can I solve this problem?
Php. ini:
session.save_handler = memcachedsession.save_path = "127.0.0.1:11211"
The runtime environment is in my vagrant virtual machine. php and memcahe are all installed in this virtual machine, php is 5.6, and memcache is 1.4.4 ,. The strange thing is that when I use files to store sessions, I have never encountered session loss problems.
Reply content:
This is an accidental loss. for example, the $ _ session I read in 2nd ajax requests is an empty array, and the $ _ SESSION value is normal for 3rd requests, however, when I initiate five or six requests at the same time on a page, it is very likely that a session will be lost. how can I solve this problem?
Php. ini:
session.save_handler = memcachedsession.save_path = "127.0.0.1:11211"
The runtime environment is in my vagrant virtual machine. php and memcahe are all installed in this virtual machine, php is 5.6, and memcache is 1.4.4 ,. The strange thing is that when I use files to store sessions, I have never encountered session loss problems.
The memcache hit rate cannot be so low. Is it because memcache is full? Or are multiple machines used in the background, and the memcache used for session storage is not shared?
The specific problem depends on the code.
The session has a concurrency consistency problem. you can lock the data when writing and release the lock after writing.
See here for an explanation: http://justcoding.iteye.com/B...