Cookies let websites identify you as you spend time online, and they’re most beneficial for websites that have return users. If you’ve ever gone to a weather website and it remembers your location based on your last visit, that’s an example of cookies in action.
When you log in to a web application or site, like a social media account or your profile on a retail website, your browser knows that you’re logged in thanks to the temporary session cookies set by the server. That session means that you can stay logged in to the site as you browse it and click through different pages. Without cookies, you’d have to log back in every time you opened a new page on that website.
This is convenient, yes, but it leaves you more vulnerable to cookie hijackers. If a hacker gains access to your session ID, they can visit the same places you did on the site, pretending to be you.