{"data":{"markdownRemark":{"html":"<p>Cookie-based authentication is stateful. This means that an authentication record or session must be kept both on server and client-side.</p>\n<p>The server will keep track of active sessions in a database. On the client-side, a cookie is created that will hold the session ID.</p>\n<p>Flow of events:\n</br>1️⃣The user enters login credentials\n</br>2️⃣The server verifies the credentials are correct and creates a session which is then stored in a database\n</br>3️⃣A cookie with the session ID is placed in the user’s browser\n</br>4️⃣On subsequent requests, the session ID is sent with the request and the server verifies it against the database and if valid, the request proceeds\n</br>5️⃣Once a user logs out of the app, the session ID is destroyed on both the server and the client.</p>\n<p>Thank you!</p>\n<h3>#developer #frontenddeveloper #webdeveloper #webdevelopment #codingisfun #worldcode #programmerrepublic #code #programming #website #frontend #backend #codinglife #educateyourself #javascript #js #es6 #webapp #web #buildupdevs #sessionmanagement #cookies #authentication #cybersecurity #fullstackdeveloper #momscancode #computerscience #compsci #coder</h3>","frontmatter":{"path":"/post-cookie-auth","title":"How Does Cookie Based Authentication Work?","author":"CodingBeenz","date":"01 May, 2019","featuredImage":{"childImageSharp":{"sizes":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAGAABAQEBAQAAAAAAAAAAAAAAAAIDBAX/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAwH/2gAMAwEAAhADEAAAAc9PPtI5Skhtg//EABoQAAIDAQEAAAAAAAAAAAAAAAECAAMxEBL/2gAIAQEAAQUCW1Y9yw3RMJMO8ZvZ/8QAFhEBAQEAAAAAAAAAAAAAAAAAAREg/9oACAEDAQE/AUbj/8QAFBEBAAAAAAAAAAAAAAAAAAAAIP/aAAgBAgEBPwEf/8QAHRAAAQQCAwAAAAAAAAAAAAAAAAERITICEFGBov/aAAgBAQAGPwI5Klm7Iy9ITt1P/8QAHRAAAwACAgMAAAAAAAAAAAAAAAERUWEQIUGhsf/aAAgBAQABPyFdwQXwij69ioipiCTzbC7pN55fGSelD//aAAwDAQACAAMAAAAQjx8A/8QAGREBAAIDAAAAAAAAAAAAAAAAAQAQITGh/9oACAEDAQE/ENAdYYL/AP/EABQRAQAAAAAAAAAAAAAAAAAAACD/2gAIAQIBAT8QH//EAB0QAQADAAIDAQAAAAAAAAAAAAEAESFhgRAxUZH/2gAIAQEAAT8QGWp+0zfouyGqQcxsWPUDzGigt7ZE0tehEezxaxuiZVT8n//Z","aspectRatio":1,"src":"/static/7c79e00e51b9338433fa672b18b7ca2b/08385/featured-image.jpg","srcSet":"/static/7c79e00e51b9338433fa672b18b7ca2b/4a8c6/featured-image.jpg 158w,\n/static/7c79e00e51b9338433fa672b18b7ca2b/845c7/featured-image.jpg 315w,\n/static/7c79e00e51b9338433fa672b18b7ca2b/08385/featured-image.jpg 630w,\n/static/7c79e00e51b9338433fa672b18b7ca2b/7320b/featured-image.jpg 945w,\n/static/7c79e00e51b9338433fa672b18b7ca2b/487eb/featured-image.jpg 1080w","sizes":"(max-width: 630px) 100vw, 630px"}}}}}},"pageContext":{"isCreatedByStatefulCreatePages":false}}