So I want to know, is it very bad to manipulate session files. What bad things I have to expect for doing that?
In my website everytime user logs in, he gets session id, and that ID is writen to DB. And every time when user logs out I delete that session id from DB and file system and regenerate new one for guest mode.
So how bad is: @unlink(session_save_path().'/sess_'.$old_sess);
Thank you.
Session data may not always be on disk(you can store session data in memcache or shared memory)
Why bother deleting the file in the first place?
http://www.php.net/manual/en/session.configuration.php#ini.session.gc-probability can be tuned to do what you want