Doc #79609 [Com]: Warning in session_create_id Example #1

From: Date: Sun, 17 May 2020 21:59:23 +0000
Subject: Doc #79609 [Com]: Warning in session_create_id Example #1
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17594@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79609&edit=1 ID: 79609 Comment by: a at b dot c dot de Reported by: software_onbekend at hotmail dot com Summary: Warning in session_create_id Example #1 Status: Feedback Type: Documentation Problem Package: Session related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: For the first question: The sample code is working fine for me. What version are you using? Do you perhaps have session.auto_start enabled? For the second question: PHP_SESSION_ACTIVE is an integer. Previous Comments: ------------------------------------------------------------------------ [2020-05-17 21:59:22] requinix@php.net Are you sure you're looking at https://www.php.net/manual/en/function.session-create-id.php? Because, > Warning: session_create_id(): Failed to create new ID in index.php on line 20. > Generating new session id is not allowed when the session is already started. The example is working for me. > Also at line 16, the if statement need an integer because the output of session_status is an > integer. It does that already. > Can the documentation for the "session-status" also be updated with the integer > return values? It does that too. > The example also uses "session_commit()", this is an alias of > "session_write_close", wouldn't it be > better to use "session_write_close" instead of "session_commit" ? The alias is not deprecated, but it probably would be better, yes. ------------------------------------------------------------------------ [2020-05-17 20:46:35] software_onbekend at hotmail dot com Description: ------------ --- From manual page: https://php.net/function.session-create-id --- Warning: session_create_id(): Failed to create new ID in index.php on line 20. Generating new session id is not allowed when the session is already started. Also at line 16, the if statement need an integer because the output of session_status is an integer. https://www.php.net/manual/en/function.session-status.php Can the documentation for the "session-status" also be updated with the integer return values? The example also uses "session_commit()", this is an alias of "session_write_close", wouldn't it be better to use "session_write_close" instead of "session_commit" ? https://www.php.net/manual/en/function.session-commit.php Have a nice day ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=79609&edit=1

« previous php.doc.bugs (#17594) next »