I execute a query to see if the user name and password match. After that I store the username in a session variable. The value is the user name after that it redirects to the admin page.
Every time I go to admin page it look for that session variable. If it is not there it will redirect me to the log in page.
Is this a safe approach to use or not?