Doc #80627 [Csd->Nab]: session_get_cookie_params options-array 1st param is what?

From: Date: Thu, 14 Jan 2021 22:25:28 +0000
Subject: Doc #80627 [Csd->Nab]: session_get_cookie_params options-array 1st param is what?
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18398@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80627&edit=1 ID: 80627 Updated by: cmb@php.net Reported by: maiksweb3 at web dot de Summary: session_get_cookie_params options-array 1st param is what? -Status: Closed +Status: Not a bug Type: Documentation Problem Package: Documentation problem Operating System: Mac OS 11.1 PHP Version: 8.0Git-2021-01-14 (Git) Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2021-01-14 21:18:57] maiksweb3 at web dot de closed ------------------------------------------------------------------------ [2021-01-14 21:17:48] maiksweb3 at web dot de Sorry, i found the problem - i gave setcookie() and session_set_cookie_params() the sane params/options-array but setcookie() needs 'expires' with timestamp and session_set_cookie_params() needs 'lifetime' with secounds.. my fault, should read errors and warnings more carefully ;-) closed. ------------------------------------------------------------------------ [2021-01-14 20:02:18] maiksweb3 at web dot de Updated summary. ------------------------------------------------------------------------ [2021-01-14 19:59:32] maiksweb3 at web dot de Description: ------------ --- From manual page: https://php.net/function.session-set-cookie-params --- Documentation does not have an example for options-array, especially the key's. User comment #9 - frank at frankforte dot ca has a wrong key: 'lifetime' It triggers error HP Fatal error: Uncaught ValueError: setcookie(): option "lifetime" is invalid in ... also 'expires' or 'expire' triggers warning: PHP Warning: session_set_cookie_params(): Argument #1 ($lifetime_or_options) contains an unrecognized key "expire" in.. PHP Warning: session_set_cookie_params(): Argument #1 ($lifetime_or_options) contains an unrecognized key "expires" in.. Or am i wrong? Test script: --------------- $cookieOpt = array( 'lifetime' => 18000, // also 'expires' or 'expire' do warning 'path' => '/', 'domain' => $_SERVER[ 'HTTP_HOST' ], 'secure' => TRUE, 'httponly' => TRUE, 'samesite' => 'None' ); session_set_cookie_params( $cookieOpt ); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80627&edit=1

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