How PHP achieves cross-session multi-page data sharing-php Tutorial

Source: Internet
Author: User
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.

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.