# Voting app question

**URL:** <https://forum.freecodecamp.org/t/voting-app-question/70290>\
**Category:** General\
**Created:** [December 29, 2016, 1:41pm UTC](https://forum.freecodecamp.org/t/voting-app-question/70290 "2016-12-29T13:41:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnnyBizzel](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/johnnybizzel/32/37661_2.png) [@JohnnyBizzel](https://forum.freecodecamp.org/u/JohnnyBizzel)\
**Post date:** [December 29, 2016, 1:41pm UTC](https://forum.freecodecamp.org/t/voting-app-question/70290/1 "2016-12-29T13:41:21Z")

</div>

I notice the Full stack voting app project will track who has voted for what.  
I get how you can track how logged in users vote, but how do you track users who haven’t logged in have voted.  
Do you have to log their IP address in the database?

---

<div class="post-metadata">

**Author:** ![PortableStick](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/portablestick/32/65591_2.png) [@PortableStick](https://forum.freecodecamp.org/u/PortableStick)\
**Post date:** [December 29, 2016, 2:40pm UTC](https://forum.freecodecamp.org/t/voting-app-question/70290/2 "2016-12-29T14:40:55Z")

</div>

The simple answer is that you simply don’t. When an unauthenticated user votes, you increment the vote count, but you don’t need to track who voted. IP addresses would be unreliable anyways. You could use a cookie, but that only works so long as the user doesn’t delete it.

---

<div class="post-metadata">

**Author:** ![JohnnyBizzel](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/johnnybizzel/32/37661_2.png) [@JohnnyBizzel](https://forum.freecodecamp.org/u/JohnnyBizzel)\
**Post date:** [December 29, 2016, 3:58pm UTC](https://forum.freecodecamp.org/t/voting-app-question/70290/3 "2016-12-29T15:58:39Z")

</div>

I just noticed the sample app does not allow you to vote for the same question twice.

---

<div class="post-metadata">

**Author:** ![kurumkan](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/kurumkan/32/13192_2.png) [@kurumkan](https://forum.freecodecamp.org/u/kurumkan)\
**Post date:** [January 15, 2017, 7:45am UTC](https://forum.freecodecamp.org/t/voting-app-question/70290/4 "2017-01-15T07:45:53Z")

</div>

They may be used cookies, or some kind of tokens stored in localStorage. But both of them are easy to delete, change. So both of them are not 100% safe. A user still can cheat the system.

* * *

I think initially requirements were - only authenticated users can vote(watch Instruction video). But I don’t understand why they changed it - now unauthenticated users can vote too…

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 1:08pm UTC](https://forum.freecodecamp.org/t/voting-app-question/70290/5 "2021-01-16T13:08:00Z")

</div>

Closed on January 16, 2021, 1:08pm UTC


