Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP - Session randomly destroyed
    primarykey
    data
    text
    <p>I use these lines to activate my session in PHP:</p> <pre><code>session_name("DELogin"); session_set_cookie_params((60*60*24*14), "/", ".myweb.com"); session_start(); </code></pre> <p>However, the session <em>randomly</em> stops working (it seems), before the set expiration time (or even a browser session). As you can see, it is supposed to last for for 2 weeks. Is there some setting that needs to be altered?</p> <p>I do not have access to php.ini, but I can change those settings through .htaccess (right?). I saw <code>session.gc_probability</code>, <code>session.gc_divisor</code> and <code>session.gc_maxlifetime</code> but I thought it should work without altering these settings. (If I should alter these, please respond)</p> <p>Thanks in advance</p> <p><em>EDIT:</em> I tried both Eugen Rieck's and Dan Walker's suggestion, to no avail. I set the settings in my .htaccess file, so I didn't have to include them on every page:</p> <pre><code>php_value session.gc_maxlifetime 1209600 php_value session.cookie_lifetime 1209600 php_value session.cookie_domain ".mydomain.com" php_value session.name "DELogin" php_value session.auto_start 1 </code></pre> <p>However, it still is 'cleared' after some time. (Investigation lead to the discovery the session still being there, but testing for <code>$_SESSION['id']</code> resulted false, which should when the user is not logged in). So either the <code>$_SESSION['id']</code> is changed to false, or the session is deleted and automatically (re-)generated with <code>$_SESSION['id']</code> false.</p> <p>What should I do?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload