DEV Community

Discussion on: Your thoughts on Creating a New User

Collapse
 
pedro profile image
Pedro M. M. • Edited

If you want to store results and the user is not logged in or there is no user yet I would recommend you to store everything in a local cache, i.e the client. For example, on a website I would use localstorage. Then all you need is to sync it with the server as soon as he logs in.

Probably I would never use server side to store anything related to non-logged users since there are no guarantees on the user uniqueness, but it depends on the situation. That said, you could store non-logged users data on server side once, but trying to retrieve this data from/for the same non-logged user is probably not a good idea since we can’t ensure he is the same person :)

Collapse
 
fcpauldiaz profile image
Pablo Díaz

Nice approach 😎