0

I am building a website. I want user to cast votes without login. But each user should allow only one vote for each question (similar to stack overflow voting system). I see somethig similar in urban dictionary (http://www.urbandictionary.com/) where you can cast votes without login. How to do this in ASP.NET MVC4?

I don't want to use cookies as someone can easily clear the cookies and vote again. How do you think http://www.urbandictionary.com/ is doing this?

Sriwantha Attanayake
  • 7,694
  • 5
  • 42
  • 44
  • Try using a combination of things to check for. You can use IP or cookies, or anything else that comes to mind really (IE their browser + OS). – Rogue Sep 28 '13 at 12:29
  • 1
    Without some kind of authentication, your users (at least the technically expert) can vote anytime they want. If you use an IP address as form of authentication then it could be hacked easily by users with dynamyc assigned address turning off the router. Stackoverflow doesn't allow upvotes if you don't have at leat 15 reps (and you are positively identified) – Steve Sep 28 '13 at 12:56
  • How do you think Urban dictionary is doing that? I tried by clearing my cookie cash and login using a different ip, but it still prevents me voting? – Sriwantha Attanayake Sep 28 '13 at 12:59
  • I don't know, but if you start some kind of monitoring software I think you could try to find out. Some kind of info is stored on your pc. – Steve Sep 28 '13 at 13:10

2 Answers2

0

I don'h think this is going to be possible unless you have some sort of persistent storage. ie a db or cookies. The only down-side of cookies is that they can be cleared.

Russ
  • 549
  • 4
  • 6
-1

I didn't try, but I suggest you may try to use Session for this porpose.

For example:

When user click on voute, set:

Session["isVouted"] = true

Now you may check: if((bool)Session["isVouted"]){don't allow to voute}. For better result you may set session time for one hour or one day.

Andrey Gubal
  • 3,481
  • 2
  • 18
  • 21