PHP Session Id changes between pages

前端 未结 10 2016
长发绾君心
长发绾君心 2020-12-07 01:07

I have a problem where i am losing the PHP session between 2 pages.

The session_start() is included in a file called session-inc.php into every page requiring a sess

10条回答
  •  我在风中等你
    2020-12-07 01:45

    While migrating a legacy site from PHP4 to PHP5 I noticed a php.ini configuration setting that causes php to auto-start the session upon every request. It's an alternative to placing session_start() onto every page...

    There are multiple ways to enable this setting:

    Put the following line into php.ini:

    session.auto_start = on
    

    or put this into your apache virtual-site config or .htaccess file:

    
      php_flag session.auto_start on
    
    

    and it should make $_SESSION changes available across all pages

提交回复
热议问题