[ DAY 134 ] Well, I still don’t know who you are

Update on my trying to authenticate user identification on my project: nothing happened. I tried but kept running into dead-ends.

But I learned something pretty cool.

There’s this thing called cookie. If you have been around since the dawn of the Internet age, you probably have experienced the annoying feeling when a little pop-up stopped you from browsing a site you wanted, though I’m not sure if they had cookies back then. Well, these cookies keep track of your visits and activity. So for example, I have an account on The Odin Project, and after I logged in, I can freely move around on the website with my account instead of having to sign in every time I reset the page. This is thanks to cookie. They remember me!

And because the cookie can store log in data, deleting it can log you out. I found that really interesting. Below is an example of when I deleted my cookie on The Odin Project. Check it out!

When I searched for https://www.theodinproject.com/, the website will redirect me to https://www.theodinproject.com/dashboard because it stores my login data in cookie. So this will oftentimes be the first thing I see when I access the website.
On my laptop, I opened Chrome DevTool with Cmd + opt + I, or you can right click and go to Inspect. Look up for the specific way to access your DevTool though. Knowing how to get around DevTool can be hugely beneficial, especially when you tinker around coding projects.
On the top bar where there are Elements, Console, Sources, Network, etc (these are all helpful by the way), navigate to “Application”.
As you can see on the sidebar, there’s “Cookies.” This is where cookies of your data is stored. I went to the https://www.theodinproject.com/ and shifted my focus to the main section of “Application.”
I selected each of the record in the table, and clicked the “X” icon at the top (where you can see “Only show cookies with an issue”). This way, I could delete all the cookies stored on this website.
Then, I reload the page. Drumroll for the magic please!
Well, I got logged out! The site immediately took my to sign_in path, and all my login data got wiped out.

I thought that was really cool. This made me understand how powerful the DevTool can be, and I got a tiny bit closer to the concept. It used to be this annoying plus mysterious plus inedible cookie, now it’s still annoying and still inedible, but it’s not mysterious. At least I got to know some part of it along the way.

As I moved on to explore more about authentication, I will definitely get to know more about set-cookie and use this to manipulate what users can see on my site. Stay tuned, folks!

Published by Thi Le


Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: