ASP.NET 3.5 and above only

Poll - Security Validation - Session


Favorite Sport
What is your favorite sport?
  • Baseball
  • Football
  • Basketball
  • Soccer
  • Hockey
  • Other
Vote
Show Results
The Poll control offers a built-in security mechanism, which can be used to prevent users from voting multiple times. Use the AllowedVotesPerUser property to indicate the number of times a user is allowed to vote and the SecurityMethod property to indicate how the security will be handled:
  • Cookies - a cookie will be created when a user votes. The advantage of this security method is that it doesn't require any coding to be performed by developers. The drawback is that the cookies are stored on the client-side (browser), and thus the users can vote multiple times if they clear their cookies, use a different browser or a different computer.
    Use this method for simple polls where the results are not mission-critical. This is the default security method employed by the Poll.

  • Session - a session variable will be created when a user votes. The advantage of this security method is that it doesn't require any coding to be performed by developers. The drawback is that the sessions are lost when the browser is closed, and thus the users can vote multiple times if they close their browser, use a different browser or a different computer.
    Use this method for simple polls where the results are not mission-critical.

  • Custom - the security checks will be performed by the developers, by handling the SecurityChecking event. This approach allows developers to check whether a user is allowed to vote using various approaches, like comparing the user's identity with the history of votes from the database, checking the user's IP address, etc. By using this security method the poll results can be more reliable and thus it is recommended for applications where the results are important.
This example showcases the use of the Session security method. AllowedVotesPerUser is set to 1, so you will be able to vote only once. If you try with a different browser or close the browser and reopen it, you'll be able to vote again.
ASP.NET
<%@ Register Assembly="Obout.Ajax.UI" Namespace="Obout.Ajax.UI.Poll" TagPrefix="obout" %>
<obout:Poll runat="server" ID="Poll1" DataSourceID="SqlDataSource1" 
     Title="Favorite Sport" Question="What is your favorite sport?"
     AllowedVotesPerUser="1" SecurityMethod="Session">
</obout:Poll>

"I just experimenting with your window and I must say that I am really so impressed with it.I am currently using teleik window but after I tried yours , I made my mind to move towards yours, what I really like about your components is the really simple API and it is light on browser, I made some tests comparing window to ... one and I must say your outtakes ..."

Ferasman

Random testimonial   All testimonials