PHP 8 · Web, security and database

Start a session

Call it before any output.

session_start();
$_SESSION['user_id'] = $user['id'];

Official PHP 8 documentation

More web, security and database commands

All web, security and database commands · PHP 8 cheatsheet

Was this page helpful?