No, it looks fine to me: , although the whole test can be simplified to just !empty($_SESSION['userid']).
If you add linebreaks so that each occurrence of $_SESSION['userid'] is on a separate line, the line number in the log will be able to point to the occurrence it finds so offensive.