Used this tutorial http://www.wikihow.com/Create-a-Secure-Session-Managment-System-in-PHP-and-MySQL to store sessions in mysql. Everything works. Compared cookies if sessions stored in files and sessions stored in mysql.
If sessions stored in mysql as i understand in cookies should not be stored any values.
Deleted all cookies, reloaded page.
However, when opened cookies I see one cookie Name _s.
Question. Why something is stored in cookies and what it means (_s)? What the cookie does (what work)? Copied from cookie value of _s and see that the value is the same as value (id) in mysql. Something wrong with php code? In such case it is useless to store sessions in mysql (if values are available in cookies)..... However see that on each page reload session value in cookie changes. It also changes in mysql and old value is deleted from mysql. So, does it means that in any case session value is stored in cookie for short time?
If sessions are stored in files. Does it means that someone copy session value from file, opens cookie, paste the value in cookie and without knowing username and password can work in website with credentials of certain user?