PHP Forms & Sessions
Client submits, server validates, session remembers.
<?php session_start();
if ($_post['username'] ?? '') {
$_SESSION['user'] = htmlspecialchars($_post['username']);
} ?>
Submit the form to see how PHP reads POST data and stores the identity in the session cookie. GET places data in the URL; POST keeps it in the request body.