if (isset($_POST['submit'])) { $username = isset($_POST['username']) ? $_POST['username'] : ''; $password = isset($_POST['password']) ? $_POST['password'] : ''; // Rest of the code goes here }
if (isset($_COOKIE['username'])) { unset($_COOKIE['username']); setcookie('username', '', time() - 3600); }This code checks if the `username` cookie is set using the `isset()` function. It then deletes the cookie using the `unset()` function and sets its expiration time to the past using the `setcookie()` function. Package/Library: This code also uses the core PHP language functions and does not require any external package or library.