Reader small image

You're reading from  Full Stack Web Development with Remix

Product typeBook
Published inNov 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781801075299
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Andre Landgraf
Andre Landgraf
author image
Andre Landgraf

Andre is a full stack developer from Germany. He graduated with an MS in Information Systems from the Technical University of Munich and was also awarded an MS in Computer Science from Sofia University in Palo Alto. Andre currently lives in Cupertino, California, and he works as a Software Engineer at LinkedIn. Andre loves learning, writing, and speaking about all things web. In his free time, he tutors aspiring developers and builds for the web.
Read more about Andre Landgraf

Right arrow

Managing visitor sessions

In Chapter 8, Session Management, we used Remix’s session cookie helpers to implement a login and signup flow. In this section, we will use Remix’s cookie helper to persist additional session data.

You might remember from Chapter 8, Session Management, that cookies are added on the server to an HTTP response using the Set-Cookie header. Once received, the browser attaches the cookie to all subsequent HTTP requests using the Cookie header.

In Remix, we can access incoming HTTP requests in our loader and action functions. In our loaders and actions, we can use Remix’s cookie helper functions to parse the cookie data from the request headers and use it to improve the user experience.

In BeeRich, we already utilize a cookie to handle the authentication of our users. However, there are plenty of other use cases for cookies.

Consider the following advanced use case: we aim to offer visitors a taste of our app’s functionality...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Full Stack Web Development with Remix
Published in: Nov 2023Publisher: PacktISBN-13: 9781801075299

Author (1)

author image
Andre Landgraf

Andre is a full stack developer from Germany. He graduated with an MS in Information Systems from the Technical University of Munich and was also awarded an MS in Computer Science from Sofia University in Palo Alto. Andre currently lives in Cupertino, California, and he works as a Software Engineer at LinkedIn. Andre loves learning, writing, and speaking about all things web. In his free time, he tutors aspiring developers and builds for the web.
Read more about Andre Landgraf