php-redis-migrate-sessions
php-redis-migrate-sessions copied to clipboard
fix bad length counter, fix handling null bytes, refactor
There were two problems for me that I fixed in this version:
- counting the length of the session string was done before escaping, so it did not count all bytes.
- null bytes were not properly inserted.
- skip non-session files (in case you have your session files mixed with other files in a dir
I also refactored a bit:
- use function instead of recursive call. Is better readable
- echo what the script does, don't echo 'find: no access to file xxx' if you have (other) files with wrong permission in the session files dir