isLoggedIn is a static method, so you can call it without instantiating the User class. What about this?
```php
if(User::isLoggedIn()) {
   $u = new User();
   ...
}
```