Signatur
session_start(array $options = []): bool
Beschreibung
Optionen können auch pro Aufruf gesetzt werden: ['cookie_secure' => true, 'cookie_httponly' => true, 'cookie_samesite' => 'Strict']. Nach dem Start ist $_SESSION verfügbar.
Parameter
| Name | Typ | Default | Beschreibung |
|---|---|---|---|
| $options | array | [] | Runtime-Overrides für session.* ini-Werte. |
Rückgabewert
Typ
bool
Beschreibung
true bei Erfolg.
Beispiele
Sicherer Start
<?php
session_start([
'cookie_secure' => true,
'cookie_httponly' => true,
'cookie_samesite' => 'Strict',
'use_strict_mode' => true,
]);