I am trying to implement a generation of HttpSession key
I am generating a random number between 1,000,000 to 9,999,999 and send it as a cookie to the user.
Is it possible to make this process secure?
anyone can make a random number like that and try to access my server…maybe I need larger range?
another question is, how can I generate number that I haven’t generate before? right now I regenerate every time that number is in use, is it possible to do it in a better way?
I have asked my self the same question and found a great answer here:
Create GUID / UUID in JavaScript?
You better read more about RFC 4122 to see if this is what you meant..
I am using this pseudo code for a NodeJS project and it does the job.
BTW: You need more than 7 digits in order to be on the safe side..