Merge pull request #3304 from Shakespeare2000/feature/session

#3073 Fix write() for session_regenerate_id(TRUE)