PHP 8.6.0 Beta 1 is available for testing

Voting

: six minus six?
(Example: nine)

The Note You're Voting On

theking2(at)king.ma
2 years ago
I generally use this to start a new session
<?php
 session_start( [ 
 'name' => DEBUG ? 'SessionId' : '__Secure-SessionId',
 'cookie_lifetime' => 0,
 'cookie_path' => '/',
 'cookie_secure' => true,
 'cookie_httponly' => true,
 'cookie_samesite' => 'Strict',
 'sid_length' => 96,
 'sid_bits_per_character' => 5,
 'use_strict_mode' => true,
 'referer_check' => $_SERVER['HTTP_HOST'],
 ] );
?>

which will create a session with increased entropy in the session cookie name, requires a secure session, make sure roque refers have no chance at my logon page among other things.
According to MDN[1] prefix "__Secure-" must be set for secure sessions.
[1](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie)

<< Back to user notes page

AltStyle によって変換されたページ (->オリジナル) /