Of course, this is safe, but there are precautions that must be taken to prevent unsafe circumstances / attacks.
There is nothing wrong with the mechanism you described. But the implementation is incomplete / nonspecific. You must consider the storage of passwords and the procedures that you will use to log in.
In response to the complaint, here some problems OWASP causes authentication / sessions.
1. Are credentials always secure during storage using hashing or encryption?
, .
2. (, , , , )?
, / .
3. URL- (, URL-)?
, .
4. ?
, , .
5. - ?
, " ", .
6. ?
, session_destroy() session_start() .
7. , TLS-?
.
, , . - , . , colorakitten.com, : " , - ".
: PHP