note 31170 deleted from function.setcookie by cmb

From: Date: Sun, 03 Mar 2019 11:29:48 +0000
Subject: note 31170 deleted from function.setcookie by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-210300@lists.php.net to get a copy of this message
Note Submitter: soreman at abv dot bg ---- If you experience problems on Microsoft Information Server (IIS) when setting a cookie via PHP and when PHP is running as a CGI binary it is not setting the cookie. After spending many hours on what the problem is here is what happens: When you invoke setcookie and redirect to another page you will not have your cookie set, because it seems that IIS doesn't set the cookie unless you actually send some contents to the browser. Therefore if you want to set a cookie and then redirect to another page you will have to do the redirection via JavaScript and/or HTML if you want your script to work on IIS.

« previous php.notes (#210300) next »