html - Handling multi tabs in a web application -


in web application, user can rate product via product page. can open multiple tabs in browser.

what best practice allow him rate different product on each tab ?

  • my first thought put product id in session : bad idea since tabs share same session , there's no way know tab active (maybe it's possible ?).
  • my second thought put in page hidden field containing id of product. solution kept moment. malicious user change id via firebug or other tool.

so wondering, there better way ?

i assume mean want force user see/rate different products, instead of same product multiple times.

quite simply, enforcement should done on server side. if user found have rated id, other requests rate should return error message (perhaps http status in 400 range).

you can fancy id , sessions, user can session playback. again, @ basic level, need server-side check.

without it, innocent user hit submit twice accidentally , you'd running same problem. fact there multiple tabs have nothing it.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -