Re: cookies not remembered between browser shutdown and browser restart.. :(
| From: | Jeffry Killen | Date: | Tue, 27 Mar 2018 17:12:23 +0000 |
| Subject: | Re: cookies not remembered between browser shutdown and browser restart.. :( | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-326414@lists.php.net to get a copy of this message | ||
> On Mar 27, 2018, at 2:18 AM, Rene Veerman <rene.veerman.netherlands@gmail.com> wrote:
>
> i have the following test script:
> <html>
> <body>
> <?php var_dump($_COOKIE);?>
> <script>
> document.write (document.cookie);
> document.cookie = 'abc=def';
> </script>
> </body>
> </html>
>
> if you load it up, you get an empty page.
> if you then refresh the page, you get that abc cookie displayed.
>
> but if you close down the browser entirely and restart it, then view the
> script output again, it doesn't show the cookie that was set earlier.
>
> what am i doing wrong here?
>
> because this used to work just fine, then it suddenly stopped working in
> both firefox and chrome.
> i'm using ubuntu and lubuntu.
The first thing I would check is if the browser prefs have been set to dump cookies
when it quits.
In the Firefox I am using, under Privacy in Preferences, there is a checkbox:
Accept from sites, and below that a sub option "Keep Until": <select/option>
I have chosen "I close Firefox" from the selection list.
I am using Firefox 54.0.1 (64-bit) on Mac OSX.
The ttl of the cookie might not be set long enough during the time the browser is
opened.
That is all I can thing of.
Best;
JK