"Al Evans" wrote:
I'm trying to work out the most reasonable way to keep track of users
"voting" for or against a particular bit of data. Obviously, I don't
want them to be able to just bang on the link -- I'd prefer to limit it
to one vote per day, for example.
I could record the fact that they've voted in the session, but I'd
really rather not have sessions for the portions of the site where
voting is relevant. This idea also seems fairly fragile.
I think limiting to one vote/session is doable, but what do you mean by
So far, the best plan I have is to add a "votes" table that records an
ip address and a time stamp. Whenever a "vote" link is hit, the
controller could find and delete all records over 24 hous old, check the
current ip address against those left in the table, then record the vote
and ip address.
Keep in mind IP addresses are not necessarily unique (i.e. users behind
a firewall). This might be more problematic than using session.