java - Restricting use for 5 minutes -
i planning on creating small website javaee user can vote every 5 minutes. there 2 buttons. 1 vote yes , other vote no. want buttons clickable every 5 minutes. whats best way this?
i thought of getting users ip , entering db along timestamp. everytime user vote ip db , check if 5 mins have passed since last vote. think of solution? best practise?
i trying avoid login or other sort of authentication. plan on using jsf, java, mysql , ajax.
one possible solution cookie containing last date of vote in client side plus saving user ip , date of vote in datatabse in server side.
if there no cookie in client side , if there 0 entry in database containing user's ip address, or if date stored in enty inferior vote recover time, user can vote.
keep in mind more people click buttons, more request server have handle.
there no risk zero, can close it.
Comments
Post a Comment