CST 336 - Module 7
Week 7,
This week’s module covers authentication using sessions. A problem with loading different pages on a web application without sessions is the fact that information is only being obtained for that page specifically. In other words, if a user logs in then loads a new page, then the user wouldn’t be logged in anymore.
Using sessions solves the problem in an easy way. In short, we can use sessions to keep track of information we would want to remember across multiple pages. Much like global variables in a program. Sessions are useful when it comes to keeping track of which user is signed in at that moment.
Besides using sessions, we were also introduced to using BCrypt to hash passwords. When creating an account, we send that information to the MySQL database. Normally there isn’t a problem with sending data to a database such as images or random information about a character in a show. However, with user’s creating accounts with their private passwords, there is now an issue of privacy. One problem that could arise is the database could be compromised, and all the passwords would be floating about the internet. Another problem would be packet sniffing, allowing people to intercept network traffic and obtain private information such as the password to an account. So, we use BCrypt to hash the password provided by a user, making it harder to understand what that password may be normally, even if the information was leaked.
Comments
Post a Comment