What does session_start do when phpsession and Cookie are enabled? Will a Session be automatically created on the server, and then a Cookie is created on the client?
Instruct Session_start to perform specific operations on the client and server after enabling Session_start.
Reply to discussion (solution)
Create a file on the server to store the session (if there is no session for the current access)
Create a cookie in the browser, PHPSESSID = session_id ()
The session is created and destroyed by statement commands. the client automatically generates a cookie that records the session id.
After a session is created, you can use $ _ SESSION (array variable, global). you can assign values to cross-page data. of course, for other pages, you can read the data, other pages must declare session_start before using $ _ SESSION.
The session id in the cookie does not need to be ignored, and you do not need to perform operations such as matching or judgment. however, to retain the data on the client, you need to use the relevant cookie statement to assign values/read values. For more information, see the manual.
There are not many Doon function statements, but they should be explained in a long article.
It is better for you to write a few more small programs for testing and understand the program test results.
Session_start () enable session
Sessions can store users' private information, which is invisible to others.
Whether to create sessionid in cookie depends on the relevant settings
As long as you know that the session is the same as the cookie, it is used to save the user's private information, but the former is saved on the server, and the latter is saved in the browser.
Session_start () enable session
Sessions can store users' private information, which is invisible to others.
Whether to create sessionid in cookie depends on the relevant settings
As long as you know that the session is the same as the cookie, it is used to save the user's private information, but the former is saved on the server, and the latter is saved in the browser.
You can get a reply from the moderator everywhere!
The moderator has helped many people!
Cookie. the server sends the data in the cookie to the client.
Session. the server stores the data on the server and sends an ID to the client.