Login functionality should use a token-based system
- Dominant language
- PHP
- Stars
- 3
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
For the sake of security, scalability and flexibility, the website shouldn't save user-information in the $_SESSION variable and instead should use a token-based approach. This includes creating a new table in the database for said token.
Steps the system should take:
1. The user submits his/her information in a login form.
2. On successful login, the server generates an unique token and is stored in a "token" table in the database.
3. The token is sent back to the user and stored in $_COOKIE using setcookie function.
4. When the server loads a page, use the $_SERVER['HTTP_AUTHORIZATION'] to check if token exists
5. If token exists, use DB query to check if token exists in DB and if it's expired or not.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.