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

Technical Spike - cookies/localstorage with react/react-router #6

Closed
astroash opened this issue Sep 29, 2017 · 1 comment
Closed

Technical Spike - cookies/localstorage with react/react-router #6

astroash opened this issue Sep 29, 2017 · 1 comment

Comments

@astroash
Copy link
Owner

Cookies will allow us to only display the instruction modal the first time users use the site. Research needed to find out:

  • how to set cookies in react/ react-router-dom
  • how to interact with cookies in react/ react-router-dom
@ameliejyc ameliejyc added this to the Milestone 1 milestone Sep 29, 2017
@astroash astroash modified the milestone: Milestone 1 Sep 29, 2017
@maxgerber
Copy link
Collaborator

maxgerber commented Sep 29, 2017

Talk with Elias:

  • Q: Is it possible to get cookies to talk to eachother within React?
    A: I would just use localstorage which would be easier?

  • Q: Would this be a problem for browsers that don't support it?
    A: As a proof of concept this wouldn't be a problem. It's also quite an old API so is quite widely supported.

  • If we were to go to the cookie route, on initial page load, we'd check for existence of the cookie, and serve loading view and a new cookie when it doesn't exist, or serve /home route otherwise. If it doesn't exists, we'd serve back the react app with a cookie. However cookies can't be sent over AJAX, only on pageload, which happens minimally on a React app.

It seems that storing this information in localstorage makes more sense for our use case

@maxgerber maxgerber changed the title Technical Spike - cookies with react/react-router Technical Spike - cookies/localstorage with react/react-router Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants