Anonymous votes are only tracked by IP

Created on 24 July 2019, over 5 years ago
Updated 27 November 2024, 2 months ago

Hi community!
I've installed the module for a public site that doesn't have a private section (it's all public/anonymous), for users to "like" nodes. At first it looked like it worked ok, but then I realized that all users from my company "shared" the votes (one voted, and another one could "unvote")... Then I realized that the problem was that since we're all behind the same router, we share the same IP (from the server POV), so all "anonymous users" were treated as one.
The site will be accessed from schools, where definitely the "users" will share IP, so I needed to change that.
Then I found that the module is not passing the "vote_source" parameter that Voting API exposes to be used when uid = 0, so by default the remote IP was used.
I've changed the module source code, and added a session token that gets initialized with the session_id() the first time the widget is shown, and is used as source parameter on widget rendering and voting, so during an anonymous user session, all votes are being casted for that "token" (allowing him to un-vote if desired). "But" I wanted to know if anyone have already been there and have a cleaner solution.
Thanks in advance!

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇦🇷Argentina mariano.tribuj

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024