Session_start (); echo SID; displays a blank page when updating?

when i run this code for the first time

<?php
session_start();
echo SID;
?>

I get something like:

PHPSESSID=9o2bhrqmln2j52caspdhholhk7

but when i update i get a blank page

Until I delete the PHPSESSION cookie and start a new one ... is this normal or am I having a problem?

+3
source share
2 answers

The manual says:

Alternatively, you can use a constant SIDthat is defined if the session is running. If the client has not sent the corresponding session cookie, it takes the form session_name=session_id. Otherwise, it expands to an empty string . This way you can seamlessly embed it in URLs.

, URL-, cookie .

+6

, . , cookie. , ? ?

+1

Source: https://habr.com/ru/post/1740279/


All Articles