Tracking users with PHP session id, cookie + database

I have a little doubt about how sessions should be handled.

Now I have a MySQL database, where in the table "users" there is a session_id field. If NULL, the user is not logged in? If the value matches the cookie value PHPSESSID, then the user is logged in.

I don’t know why, but somehow I feel that it’s not good enough to see who I am dealing with. Is there something I'm missing, or are my fears unfounded?

+3
source share
3 answers

There is nothing significant in what you describe as far as I can judge.

, . ( ..). , . , .

+2

, , " " , , , , . , -, , , - , - (, , 15-30 PHP) , X .

+2

- 1 . , , :

sess_id | sess_userid | sess_ipv4 | sess_lastseen (datetime/timestamp) | sess_sessionid (varchar)

, , , IP-, , , .. , .

, !

, , , ( 15 ?) ., - , , id .

+1

Source: https://habr.com/ru/post/1760911/


All Articles