Why does forgetting to call session_start() cause session_register_shutdown() to not work properly?
A common but easily overlooked problem when using PHP to handle sessions is that if the developer forgets to call session_start(), even if session_register_shutdown() is registered, it will find that it does not execute or take effect as expected. This situation often confuses beginners. This article will analyze the principles behind this phenomenon in depth and explain them through code examples.
session_register_shutdown