> I imagined this would require storing an ‘anonymous visitor ID’ in the cookie

This thing already exists as session id in `_osm_session` cookie. And that's 
another option. Instead of managing the counter and its expiration date in 
javascript, you can make a request at some special endpoint after a note is 
successfully created here 
https://github.com/openstreetmap/openstreetmap-website/blob/97b14ce22a0c7d17bb0b303b3795297721bc31d4/app/assets/javascripts/index/new_note.js#L48
That request will increase the counter stored in `session` if necessary. After 
that `app/views/notes/new.html.erb` or its controller can check the counter 
value and display the message based on that.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5468#issuecomment-2572497552
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/5468/c2572497...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to