Re: ini_set()
| From: | Gustav Wiberg | Date: | Tue, 13 Sep 2005 20:13:13 +0000 |
| Subject: | Re: ini_set() | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-222290@lists.php.net to get a copy of this message | ||
----- Original Message ----- From: "Richard Lynch" <ceo@l-i-e.com>
To: "Gustav Wiberg" <gustav@varupiraten.se>
Cc: "PHP General" <php-general@lists.php.net>
Sent: Tuesday, September 13, 2005 9:26 PM
Subject: Re: [PHP] ini_set()
On Tue, September 13, 2005 2:11 pm, Gustav Wiberg wrote:What happens if ini_set AFTER session_start(). Doesn't it affect anything then? /G http://www.varupiraten.se/Hi there! I don't get it... From the manual... string ini_set ( string varname, string newvalue ) Sets the value of the given configuration option. Returns the old value on success, FALSE on failure. The configuration option will keep this new value during the script's execution, and will be restored at the script's ending. Does this mean that: File phpcode1.php handles cookies and has the code ini_set('session.cookie_lifetime',2147483647); ini it. File phpcode2.php has nothing to do with cookies When user goes TO phpcode2.php FROM phpcode1.php, session.cookie_lifetime would be zero and ended when browser is closed...?No. It means that *IF* you do that ini_set() before you do session_start() *THEN* the Cookie sent out in phpcode1.php will have a theortical lifetime of about 33 years. phpcode2.php would be affected only if it did session_start(), and the effect would be that the cookie would be theoretically available (and the session tied to it) for 33 years. I say THEORETICAL above because browsers are allowed to discard cookie life-times longer than 2 years (??? check specs ???) on the assumption that 33 year life-time cookies are just plain stupid mistakes on somebody's part. YMMV NAIAA IANAL -- Like Music? http://l-i-e.com/artists.htm -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.23/99 - Release Date: 2005-09-12 Thanx a lot! I think it is clearer now... :-)