S
S
SimBioT192015-09-02 11:31:59
PHP
SimBioT19, 2015-09-02 11:31:59

How to make a hash universal?

When authorizing a user, I write a hash (email + password) in cookies, i.e. in fact, it is always the same, but I want it to be unique every time. I tried adding the last 3 digits from time() , but in this case, if a person logs in from one browser and then from another, the cookies will be different and, accordingly, in the first case, the user will not be authorized, because the cookies are in the database and browser is different .
How to make "cookies" universal, so that the hash is different every time, and authorization works even if you need to log in from several devices at the same time.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Volintsev, 2015-09-02
@SimBioT19

Store issued authorization keys in a separate issued key table, not in the user table.

M
Mikhail Osher, 2015-09-02
@miraage

php.net/manual/ru/function.password-hash.php
php.net/manual/ru/function.password-verify.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question