```
if($_POST['user'] == 'anita' && $_POST['pw'] == '123')
{
    $_SESSION['username'] = $_POST['user'];
    echo "Welcome, " . $user;
    $loggedin = true;
}else
{
    die('Log in details incorrect.');
}

if(isset($_SESSION['username']))
{
   // Show website edit menu
}

```

I'm creating a website and I was thinking about adding a small self made CMS for my customer to use, so she can update the site herself.

Is this a safe way to save someones details? can I just check if $\_SESSION['username'] is set to validate that the user is logged in?