I got a logical problem with this code:
<?php
if(isset($_POST['submit'])) {
if($_POST['username'] != "" && $_POST['password'] != "") {
$_SESSION["user"] = new User();
$_SESSION["user"]->login($_POST['username'], $_POST['password']);
}
}
?>
But after refreshing the page , the session is empty. Does somone know why the session could be empty? The login function is working correctly (tested it with fixed login data at every reload of the page).
Thanks in advance!