When calling session_start() for the first time, a new session will be generated. Later, when session_start is called again, the session will be resumed using the session id in the cookie (or from GET/POST request if session.use_trans_sid is turned on on the server) sent by the client.
For enhanced security, a new session id can be re-generated for the user from time to time, even when he/she has not logout/login again.
Does this behavior happen automatically, meaning that this is the default setting on most web servers? Or it requires manual coding?
It does not happen automatically.
You have to use
session_regenerate_id().It is a good practice that you change the session id at least every time the user’s privilege level changes (simplest example being when he logs in).