Saving likes in a post after refresh

What I am trying to do is to save a binary (liked yes or no) for a certain post from an unlogged user, so that once page is refreshed the system know he has alreaded liked and he is not able to like it again.

For example in instagram, where I can like posts with logging in, but if I refresh the page the system know which posts where already liked (of course I didnt tried it after a few days, just a few minutes).

I believe saving that info in a cookie would be a solution, but how can I do that in bubble? As custom states are flushed once page is refreshed, I loose the information as well.

Any hints?

Well if the user is not logged in then it’s is going to be a bit difficult because how would bubble know that the user who is using the site has already visited the site or not. Even if I talk about Instagram or any other big social networking site they allow only the logged users to like a post. It’s easy to do that way

1 Like

@akul3007 cookies would do it, but as far as I’ve read, bubble doesnt support them, that’s the problem… but with cookies that wud be fine, just wondering if someone got a solution for that already! :expressionless: tks mate

I would navigate to the same page and pass a parameter to it. Then when your user is ready to create an account pass him to page with the same parameter values and capture it in the workflow.

1 Like

For whoever it matters, I solved it myself… just posting what I did in case anyone else needs it, or is willing to anticipate any flaws!

  • lets call OBJECT whatever the object is being voted/liked
  • created a new text field for this object called VOTER, and set it to be a list
  • when the vote button in pressed, make a change to a thing and add the current user unique ID to the object VOTER
  • did a conditional in the vote button not to be visible when the object’s vote field contains the current user unique id

this way I can store votes for unlogged users that will not disappear once the page is refreshed (taking advantage of bubble’s own cookies to save the current user for 3 days, so once this cookie expires the user can vote again, but thats fine for me)

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.