How do frames affect session handling in PHP?
Frames can affect session handling in PHP by causing session data to be shared between frames, which can lead to security vulnerabilities. To prevent this, you can set the session cookie to be accessible only to the current domain by setting the session cookie parameters. This will ensure that session data is not shared between frames on different domains.
// Set session cookie parameters to be accessible only to the current domain
session_set_cookie_params(0, '/', $_SERVER['HTTP_HOST'], true, true);
session_start();