DWQA QuestionsCategory: ProgramSession cookie problem in website development
Success in learning asked 9 months ago

In website development, it is popular to use the session and cookie mechanism in the server, or to implement a set of session and cookie mechanism by custom. If there are many user-defined session and cookie mechanisms, how can we design this set of session and cookie, and ask the gods to give us a more comprehensive set of user-defined session and cookie mechanism.

eechen replied 9 months ago


2 Answers
wudanyang answered 9 months ago

It depends on the demand. Most of them come with them.

Don't leave me fresh answered 9 months ago

Usually we go back and use some development frameworks as a starting point for a project.
Most frameworks provide a way to manage server sessions and browser cookies more easily.
Similar to ThinkPHP, it provides better session and cookie management tools.


use app\Controller;
use app\Session;

class example extends Controller{
    public function exampleAction(){

In the same way, cookies have similar direct management tools, which can help you manage sessions and cookies more easily.