PHP Generate Random 128-bit for persistent login -


i'm making persistent login using this setup.

how understood need table username , hash of cookie token. can have multiple tokens 1 user.

the issue i'm having need random token. in article advise 128 bits, 16 hexadecimal values guess. these need random, because important. store them, i'll bcrypt() them, if db compromised still takes 'long' before cookies can used login account.

tl;dr: need true random 128-bit string/number/... . i've found several methods, don't know ones random.

don't reinvent wheel (especially cryptography, you'll make worse 99% of time).
try openssl implementation.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -