on-internet
← Community

Resuming an existing PHP session twice makes the server send the session cookie

Stack Overflow ·

I apologize in advance if this is such a basic question, but I can't get my head around it. I'm using php-fpm on Apache. I call start_session() for the first time. The server sends the Set-Cookie header with "PHPSESSID", as expected: <?php session_start(); session_write_close(); die(); ?> In subsequent calls to the same script, the server does not send the Set-Cookie header, as the session is resuming rather than starting for the first time, as expected. Then, I modify the script and add another session_start() and session_write_close(). Now, the server always sends the Set-Cookie header, with

Comments

Sign in or sign up to comment and upvote.

No comments yet.