Which PHP function can be used to regenerate a session ID to prevent session fixation attacks?

  • session_regenerate_id()
  • session_start()
  • session_unset()
  • session_destroy()
The session_regenerate_id() function in PHP can be used to regenerate the session ID, which helps prevent session fixation attacks. It generates a new session ID and transfers the session data to the new ID. Regenerating the ID makes it difficult for attackers to predict and hijack a user's session.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *