assume an ordering application, user "Ben" would be able to list a specific order by issuing
/order/1
now .. before doing that i've authenticated "Ben" (username/password auth) and sent the username as a cookie (signed with a sha1 checksum).
on each http request i receive the cookie that tells me "Bent" is still authenticated, but who can stop him from issuing
/order/23
where order with id=23 does not belong to "Ben".
so i guess i should write some logic to make sure that order 23 actually belongs to "Ben" ... is that a best practice or pattern for this kind of situation ?
should i use a separate "functional primary key", instead of a serial primary key id ?