What are some common reasons for sessions and cookies not being created on a different server when migrating a website?

When migrating a website to a different server, sessions and cookies may not be created due to differences in server configurations or paths. To solve this issue, make sure to update the session save path and cookie domain to match the new server settings.

// Update session save path
session_save_path('/new/session/save/path');

// Update cookie domain
ini_set('session.cookie_domain', '.example.com');