Merge pull request #3304 from Shakespeare2000/feature/session

#3073 Fix write() for session_regenerate_id(TRUE)
#3073 (feature/session): Implement automatic ID regeneration
#3073 (feature/session): Don't regenerate IDs on AJAX requests
#3073 (feature/session): Fix a typo from ff37ffe164443e53b24d529f967a1bdf065bff3a