开发者

create unique hash per browser and page

开发者 https://www.devze.com 2023-03-15 23:49 出处:网络
I am creating a web application in c#. I want to create a unique ide开发者_运维百科ntifier for the current user on to be used on the current page. This idenitfier is just for this page and this users

I am creating a web application in c#.

I want to create a unique ide开发者_运维百科ntifier for the current user on to be used on the current page. This idenitfier is just for this page and this users session. So it will vary per user, browser etc. I have an id for the user that I can use but also want to use a unique identifier for the browser eg session id. So I will create a hash based on user id, ip address, page identifier and browser identifier.

Is there a value from the user httprequest object that I could include in the generation of the hash?


REMOTE_ADDR will give you the IP
HTTP_USER_AGENT will give you the browser
SCRIPT_NAME will give you the current script running (page)

Just access those values using the Request.ServerVariables collection

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号