Simple question.
I am using sessions on my site for my login system. Each page that is secured will need to check whether the user has logged in or not.
How best to do this:
1) Use a SESSION variable called $loggedin which is set to Y or true.
2) Use SESSION variables to store username/password which will be checked against the database on every page.
I'm guessing option 1) is as secure as option 2) without unnecessary database hits.
Any suggestions.