The PHP 7 development framework I wrote myself has no session concept. I want users to use cache + cookies to solve the problem. In fact, I want to know, simple maintenance of user login using cookies symmetric encryption and storage, then php decrypts the table and session records the user uid, and then look up the table is actually nothing... the session concept is no longer found in the PHP 7 development framework I wrote myself.
I want users to use cache + cookies to solve the problem
In fact, I want to know, simply maintain user login
Store with cookies symmetric encryption and then decrypt the table in php
There is no essential difference between recording user uid and checking table with session
DIGRESS
It is not impossible for cookies to store users' hash passwords and usernames to simulate logon once each time.
In fact, the database or cached data should be comparable to the session's practicality
After all, the session has a recovery mechanism. When 0.1 million people log on to the website every day, the session mechanism may bring about a more cruel I/O bottleneck than the database bottleneck.
Another digress
The shopping cart implementation actually directly retrieves the cache
Key VALUE
User ID. shopping cart content
Actually, that's okay.
The details of the product information are in the form of a table or cache query.
I hope that you can tell me what the significance of using session is. since it is so random and unreliable
Reply content:
The session concept is no longer found in the PHP 7 development framework I wrote myself.
I want users to use cache + cookies to solve the problem
In fact, I want to know, simply maintain user login
Store with cookies symmetric encryption and then decrypt the table in php
There is no essential difference between recording user uid and checking table with session
DIGRESS
It is not impossible for cookies to store users' hash passwords and usernames to simulate logon once each time.
In fact, the database or cached data should be comparable to the session's practicality
After all, the session has a recovery mechanism. When 0.1 million people log on to the website every day, the session mechanism may bring about a more cruel I/O bottleneck than the database bottleneck.
Another digress
The shopping cart implementation actually directly retrieves the cache
Key VALUE
User ID. shopping cart content
Actually, that's okay.
The details of the product information are in the form of a table or cache query.
I hope that you can tell me what the significance of using session is. since it is so random and unreliable
1. do not put the user password information in the Cookie, even if it is encrypted, there is a security risk.
2. since the cache is used, it is better to directly access Redis. The product information and the user's shopping cart can be placed in the Redis Hash table.
No problem. that's what restful means.
The reason is that session is convenient.
Oh, you should not look up the table for every simulated login. it is better to get a redis or something to save the user information that has been logged in recently.