Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Sessions): create user sessions and persist on cookies #5

Merged
merged 3 commits into from
Nov 24, 2022

Conversation

mapra99
Copy link
Owner

@mapra99 mapra99 commented Nov 24, 2022

Sessions functionality is implemented here - The API will be called to create a session record and return an identifier that will be saved in a browser cookie with 1 hour of expiration. The root's loader will check on every page load that the cookie exists, and will call the API and create a new session every time the cookie expires.

Sessions will later be used to identify the visitor and add the ability to persist some things, such as purchase carts.

@mapra99 mapra99 requested a review from ImMPrada November 24, 2022 03:20
@mapra99 mapra99 changed the title feat(Sessions): create user session and persist on cookies feat(Sessions): create user sessions and persist on cookies Nov 24, 2022
Copy link
Collaborator

@ImMPrada ImMPrada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@@ -0,0 +1,60 @@
import { createCookieSessionStorage } from "@remix-run/node";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

@mapra99 mapra99 merged commit 82c060b into main Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants