473,382 Members | 1,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Check user

Hello,

I am creating a Poll system and I need to check if a user has already
voted.

What should be the best way to do this?

1. Should I save the user IP along with its vote in the database?
But does not some users IP change each time they access the
internet?

2. Should I place a cookie in after the user voted?

Well, any help will be great.

Thanks,
Miguel

Dec 19 '06 #1
4 1417
Hi,

shapper wrote:
Hello,

I am creating a Poll system and I need to check if a user has already
voted.

What should be the best way to do this?

1. Should I save the user IP along with its vote in the database?
But does not some users IP change each time they access the
internet?
It can, yes. IP is not reliable as identification of a person.
>
2. Should I place a cookie in after the user voted?
It will only identify the browser that the user is using. If the user
changes PC, clears the cookie, or if another user uses the PC, you'll
have problems. So cookies are not reliable for identification of a person.
Well, any help will be great.
Unless you implement a login system, with a secure password, and only
allow logged-in users to vote, you won't be able to do this reliably, I
fear. The Internet is pretty free. That's what allows you to post under
a nickname ;-)

One possible method is to ask the user politely to vote only once. That
will be at least as reliable as using cookies or IP...

Thanks,
Miguel
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Dec 19 '06 #2
Cookies are the usual approach for this kind of thing.
They're not especially secure but for most polling systems they're secure
enough.
IP addresses won't do the trick since those are changed and shared
frequently by various proxy servers.
If it's important that your system be secure then the best bet is probably
to implement a username & password login authentication system.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"shapper" <md*****@gmail.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Hello,

I am creating a Poll system and I need to check if a user has already
voted.

What should be the best way to do this?

1. Should I save the user IP along with its vote in the database?
But does not some users IP change each time they access the
internet?

2. Should I place a cookie in after the user voted?

Well, any help will be great.

Thanks,
Miguel
Dec 20 '06 #3
This is just a simple poll.
It does not need to be really accurate.

I think I will go for the cookie.

Thanks,
Miguel
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] wrote:
Cookies are the usual approach for this kind of thing.
They're not especially secure but for most polling systems they're secure
enough.
IP addresses won't do the trick since those are changed and shared
frequently by various proxy servers.
If it's important that your system be secure then the best bet is probably
to implement a username & password login authentication system.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"shapper" <md*****@gmail.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Hello,

I am creating a Poll system and I need to check if a user has already
voted.

What should be the best way to do this?

1. Should I save the user IP along with its vote in the database?
But does not some users IP change each time they access the
internet?

2. Should I place a cookie in after the user voted?

Well, any help will be great.

Thanks,
Miguel
Dec 20 '06 #4
Hi,

shapper wrote:
This is just a simple poll.
It does not need to be really accurate.

I think I will go for the cookie.

Thanks,
Miguel
That's probably a good idea. You should ask the user for a name anyway,
to avoid blocking users who didn't take part to the poll yet.

To set or read cookies on the client, see
http://www.galasoft-lb.ch/myjavascri...701/index.html

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Dec 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
3
by: Greg Scharlemann | last post by:
Does the redirect statement: header(Location:"http://www.newpage.com"); need to come before certain statements? I've setup a login page and try to redirect a user once they have logged in...
6
by: Shannan Casteel via AccessMonster.com | last post by:
I'll explain as well as possible...not an experienced user...but learning. I am working on a database for different kinds of problems with machines. A user will be able to select a problem...
3
by: TK | last post by:
Excuse me for multiple posting because I've posted this message to aspnet.security NG but have not got any response yet. I'm building an ASP.NET application works in Forms Authentication mode...
9
by: Sameh Ahmed | last post by:
Hello there Is there a way through dotNet to check if a certain user is a member of a specific group? I use ADSI to get the memberships of the user then compare them to the group I want to check,...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
1
by: =?Utf-8?B?R2FuZXNoIE11dGh1dmVsdQ==?= | last post by:
Hello All, Our application write logs to a file in a folder. Before our application starts writing to that file, I want to check if the current user has write access to that file, for example,...
19
Frinavale
by: Frinavale | last post by:
Filtering user input is extremely important for web programming. If input is left unfiltered users can input malicious code that can cripple your website. This article will explain how to make...
3
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
I've a multiview with 3 views. on view 2 the user is presented with a check box list (items from database) at view 3 the user can review their selections and, either post to the database or go back...
2
by: asdf | last post by:
So I'm writing a script which will create several instances of User() class. I want each instance to be named after the login name of a user. I don't know beforehand how many users the script will...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.