How does PHP achieve cross-session multi-page data sharing? How does one achieve cross-session multi-page data sharing? for example, I want to query user permission data and store it in an array once, during the next login, the same user can directly match the data from the array without checking the database again.
Reply to discussion (solution)
Save with session
Save with session
The session does not work. I need to implement the cross-session function. the session can only be in the session. I think different pages without a session can access the same array.
A session is a cross-session
A session is a cross-session
The session is in the session. when the page is closed or the user logs out, the session data will be cleared.
The SESSION can be fully implemented, or it can be implemented by using NOSQL, depending on the requirements.
Frequent queries using NoSQL
Store data in memcache
Use session/cookie.
The session should be able to meet your requirements.
Save with session
The session does not work. I need to implement the cross-session function. the session can only be in the session. I think different pages without a session can access the same array.
What does cross-session mean? All users use the same permission settings? Is it okay to write a file at will?
If each user has different permissions, isn't session used? But you don't want to check the database? At this time, you can read from the above mentioned files and then differentiate them.
The user permission is stored in the session and can be determined during initialization.