开发者

java. Unique identifier for each visitor. How better generated?

I need to generate a unique identifier (uniqueID) for each visitor my site. Which algorithm is better use for this? Have any ideas?

Update: small condition: do not u开发者_StackOverflow社区se Session Id.


The easiest would be to store a UUID in the Session.


How about just using the web container's Session ID?

See HttpSession.getId()


I usually use microsec time, but if two users somehow get on at the exact same time i add a random number to the end of it. (still a possibility for repeats, but very unlikely)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜