Using Sessions Without Cookies
One of the problems with sessions is that, as it stands, they rely on the use of a cookie to work properly. When a session is started, it sends a cookie that resides in the user's Web browser, which contains the session name (Figure 5.21). Every subsequent page that calls session_start() makes use of the cookie to know to use an existing session and to not create a new one. The problem is that users may have cookies turned off in their Web browser or may not accept the cookie because they do not understand its purpose. If this is the case, PHP will create a new session for each page and none of the registered variables will be accessible.
You can use sessions without cookies by passing along the session name from ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access