This question already has an answer here:
I want to know about the clients who use my web site are they already voted or not.
Like for a star Rating system. So what is the best technique to find this?
</div>
The risks you run with each:
How important is it to avoid the fraud in option 1? If you have the means to "discount" excessive votes from a single IP address (i.e. cleanse vote records where total # from a given IP exceed some threshold), then cookies would be easiest and most widely accepted. Alternatively, you can use a combination of cookie and localStorage to further deter those who wish to over-vote.