Should I obscure primary key values?

后端 未结 10 2364
借酒劲吻你
借酒劲吻你 2021-02-13 02:33

I\'m building a web application where the front end is a highly-specialized search engine. Searching is handled at the main URL, and the user is passed off to a sub-directory wh

10条回答
  •  轮回少年
    2021-02-13 03:10

    If you're worried about someone altering the URL to try and look at other values, then perhaps you need to look at token generation.

    For instance, instead of giving the user a 'SearchID' value, you give them a SearchToken, which is some long unique psuedo-random value (Read: GUID), which you then map to the SearchID internally.

    Of course, you'll also need to apply session security and soforth still - because even a unique URL with a non-sequential ID isn't protected against sniffing by anything between your server and the user.

提交回复
热议问题