Closed EhsanZ closed 9 years ago
@EhsanZ You placed everything in single action, and it should be in different actions. Since it's all javascript what evercookie.js is doing is restoring normal cookie from evercookie values. First of all set_evercookie
must be called in view.
View that you are showing with vote options (the one before the posted action is done) should include check_evercookie
, it will execute javascript to check for evercookie and will restore normal cookie.
After that you will be able to use evercookie_is_set?
and evercookie_get_value
.
Anyway you should take into consideration, that evercookie can be blocked. So you still will be able to get multiple votes if user will block it, because whole library stores data on client side.
Additionally check this section. I described there how I used it with registration. Your case is almost the same.
Hi
I want to prevent visitors from voting multiple times using Evercookie, I followed README instructions to setup the gem but I'm having a weird issue.
Everytime I vote it creates a new evercookie, it looks like it is just a temporary cookie that being deleted immediately, I don't know if I forgot something that haven't been mentioned in README or if I should add a specific JS files to get it works, or if I missed some setup steps.
Here it is my voting code
My Gemfile
My config file
Ruby version 2.0.0, Rails 4.2.1.