This is a user login (some session wrapper I managed to put together after a lot of web searching).
It's for a simple CMS I'm trying to build. It only needs one user and there is no need for multiple user log in at the same time. It works, the problem being I think it has safety issues.
It works like this:
- The user accesses CMS index page, and inserts the user and password.
- If one of them does not coincide with the data in the database it does not set the session and triggers a "die" or a error message.
- If the info is ok then it sets the session and redirects the user from the index page to an admin.php page as you can see in the code below.
I commented it quite well. If you see any safety issues please point them out as I can't seem to notice them.
The form is a simple user, password and submit form.