by usrbinbash · 4y ago · 0 comments
2. How is validating the session-cookie validity different from validating the username/password?
For many of my internal tools I don't even bother with a database and just store it in local RAM, especially when I have no other database involvement, because having all sessions reset every few months during a reboot or restart is worth it to not have to stand up a database solely for that purpose. In that case it's just a quick lock&lookup in a map/dict/whatever your language favors to see if the token matches or not.
Validating codes is done with fast crypto algorithms, while validating passwords uses purposefully slow algorithms.