Try using
session_write_close()
Before redirecting. It could potentially be a race condition. Other than that, you might want to check the cookie store on a device where it's not working - the browser might not set the cookie for some reason (that is, if you're using cookies and not url query parameters, which is also possible with php). You might also want to check cookie options on
setcookie(...)
especially $secure
and $httponly
in case you're setting the cookie yourself. Also make sure $expire
is set to a future date and in the correct format (timestamp) if you're using that parameter. For more info see
http://php.net/manual/en/function.setcookie.php
Another reason might be that it's not the device/browser, but where they are connected to the internet. A proxy might cache responses (there are some really strange proxy configurations out there, some of which ignore setcookie headers and just pass the cached page without those) which might be the reason it's not working.
Another thing I could think of is that your session store doesn't save the session sometimes. By default most php installations save sessions to files and then they are regularly deleted. If the partition / mount point / ... is full, the session will not be saved. You should be able to check this if you have a look at server error logs (that is, if you have error logging enabled and configured on your server)
Yet another reason might be that the specific browsers send the do-not-track header information and for some reason this makes your server not send the cookie (this would be an extreme edge case, as normally most servers just ignore do-not-track information, but who knows ...)