Is session browser-based?

1. Such as the question, is it possible that sessionID? will not be generated if the request is not made through the browser?

2. On a deeper level, is there no Set-Cookie field in the response header header if it is not requested through the browser?

3. In addition, how to test and observe this thing

Apr.22,2021

has nothing to do with the browser. You can use curl to request http, to view head information


is not directly related to the browser.
session is saved on the server, cookie is saved on the client, and session_id is saved on the client as cookie to identify the user.
on the first request, php detects whether the cookie, of session_id is present. If not, it generates a session, and responds that the set-cookie, browser will save the cookie when it receives the set-cookie. When
requests again, the browser will automatically bring cookie,php to get session_id from cookie.


you can set Set-Cookie, but the browser will keep cookie, and bring it automatically next time. Not on the command line, display settings are required

Menu