I have searched and searched, but nothing seems to match my issue.
In my development environment, I have some PHP scripts to generate HTML to the client. I created my own custom sessions manager, and everything in my code is working (so far) until I try to send a cookie on a new session. Here is some code to give an idea:
<?php
class Session {
private $data = null;
private $id = null;
private $token = null;
private $access = null;
private $oldID = null;
private static $ck_limit = 180;
private static $ck_domain = "kiosk.local.com";
...
public function __construct() {
setcookie("id", $this->id, (time() + self::$ck_limit), '/', self::$ck_domain, true, true);
}
?>
The browser gets the cookie just fine according to Firebug, but in the cookies list, it's nowhere to be found! Page refreshes don't do anything, and no cookies seem to be making it to the client storage. The links are absolute paths, over HTTPS, certs are permanently stored and trusted, and changing between any of these settings yields no cookie.
I tested cookie reception with google in the same browser, and they work.
Just in case someone asks, my machine's hostname is an FQDN of kiosk.local.com and my hosts file has it mapped to its interfaces. This isn't my first server, but it is the first time I am dealing with cookies in PHP.
I ensured that there is NOTHING being sent to the client prior to sending the cookie, and I tried sending it with nothing, an empty page, and the page I am sending it regularly, and tried without output buffering.
Is there any reason this should be happening? My error.log for apache says nothing about a cookie, and the PHP setcookie() method returns true, and Firebug reports no errors whatsoever on the page load... just no cookie in the cookies list. I can see the cookie data in the received header, but that's the only indication that the server is doing its job.
Browser is Firefox 40.0.3 for Ubuntu 12.04.3 LTS, Extensions are Firebug, FireQuery, Firefox HTTP authentication from sub-resources Hotfix, and Ubuntu Modifications.