Avoiding a call to session_regenerate_id() when there is no id

It makes no sense to regenerate the session id when there wasn't one previously

Fixes #4312