I have a trouble when i try to verify if a user exists in the database.
$login = $this->cookies->get('login');
$loggedinas = $login->getValue();
$user = Users::findFirstByUsername($loggedinas)
This returns:
PHP Notice: Trying to get property of non-object in /public_html/app/views/charactersheets/create.phtml on line 27, referer: localhost/charactersheets
However if i use this:
$user = Users::findFirstByUsername("pentacore")
it works, and i've checked so that the cookie contains the right username with var_dump() which returned pentacore so... what could be the problem?