hello there
I am creating a cookie with php which actually does exist because I can check it in the opera browser for example:tools-preferences-advanced-cookies-manage cookies. The cookie does not get saved for next time I open the browser though. Do you know how to fix this?
The example is for a cookie which remembers the language in http://www.metatradersoftware.com. May be you can check with your browsers what I mean.
Thanks in advance
cookie does not get saved
Moderator: General Moderators
-
thosecars82
- Forum Commoner
- Posts: 94
- Joined: Thu Apr 03, 2008 6:31 am
- Location: Arganda, Madrid
- Contact:
Re: cookie does not get saved
you need to set a time limit on the cookie.
will expire after an hour.
will expire after a day
Code: Select all
setcookie('yourname','steve',time()+3600);Code: Select all
setcookie('yourname','steve',time()+86400);-
thosecars82
- Forum Commoner
- Posts: 94
- Joined: Thu Apr 03, 2008 6:31 am
- Location: Arganda, Madrid
- Contact:
Re: cookie does not get saved
Thks for that effective reply.panic! wrote:you need to set a time limit on the cookie.
will expire after an hour.Code: Select all
setcookie('yourname','steve',time()+3600);
will expire after a dayCode: Select all
setcookie('yourname','steve',time()+86400);
-
thosecars82
- Forum Commoner
- Posts: 94
- Joined: Thu Apr 03, 2008 6:31 am
- Location: Arganda, Madrid
- Contact:
Re: cookie does not get saved
Guess what's the problem now?thosecars82 wrote:Thks for that effective reply.panic! wrote:you need to set a time limit on the cookie.
will expire after an hour.Code: Select all
setcookie('yourname','steve',time()+3600);
will expire after a dayCode: Select all
setcookie('yourname','steve',time()+86400);
I get this message:
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\pruebalocal1\metatradersoftwarecaca\anexos\header.php:8) in C:\xampp\htdocs\pruebalocal1\metatradersoftwarecaca\anexos\header.php on line 159
Does anybody know how to avoid that the setcookie function throw this warning?
Thanks in advance
-
thosecars82
- Forum Commoner
- Posts: 94
- Joined: Thu Apr 03, 2008 6:31 am
- Location: Arganda, Madrid
- Contact:
Re: cookie does not get saved
solvedthosecars82 wrote:Guess what's the problem now?thosecars82 wrote:Thks for that effective reply.panic! wrote:you need to set a time limit on the cookie.
will expire after an hour.Code: Select all
setcookie('yourname','steve',time()+3600);
will expire after a dayCode: Select all
setcookie('yourname','steve',time()+86400);
I get this message:
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\pruebalocal1\metatradersoftwarecaca\anexos\header.php:8) in C:\xampp\htdocs\pruebalocal1\metatradersoftwarecaca\anexos\header.php on line 159
Does anybody know how to avoid that the setcookie function throw this warning?
Thanks in advance
Re: cookie does not get saved
glad to be of service.