Persistence - Double Header
Daily Standup
September 15, 2017
Two days in a row, success! šššššš Now when a user logs into the site and the server is restarted, they are still logged in afterwards.
Refactoring Mess
I got help figuring out the issues at a Meetup event tonightā¦it was so useful! When I left off yesterday, I could see that the user session was indeed being created and stored in the database (good), but for some reason when they log in it would redirect them back to the login page rather than going to the userās dashboard (bad).
The person who helped me showed me a bit more of the Chrome developer tools I hadnāt seen before. With this we were able to see that it was going to the dashboard, just quickly routing again back to login. Hmmm.
Then we rolled back to the last version that allowed the login to work, and did the refactor again step by step. The key thing was testing that it still worked after every change. For some silly reason I didnāt do that yesterday when I moved and changed all the code around! Rookie move, thatās for sure. Going through step by step I was able to find the one section of code that was breaking the whole thing. Not surprisingly it was a section I didnāt fully understand, other than it was what the package docs said to do.
Eventually I figured out that some of the options were configured for an HTTPS environment, and when I adjusted them it started working. So now itās completely working as it should!
Well, almostā¦
Thereās now a weird thing happening where it takes two attempts to log into the site. Even worse, if you try one user on the first attempt and a different user on the second attempt, it logs you in as the first user! Pretty critical error, so thatās what Iāll be working on next.
Up Next
Iāll also need to put this aside eventually to finish the CS50 assignment this weekend.