April 2026
Intermediate
1009 pages
34h 15m
English
Let’s demonstrate what we’ve learned with an application example. Because cookies can be deactivated by the user, it is important to determine whether a user accepts cookies at all or not. Such a test can be created relatively quickly.
First, cookies must be sent to the web browser. As most browsers now handle temporary and permanent cookies separately, you should test both types of cookie:
setcookie("CookieTemp", "ok"); setcookie("CookiePerm", "ok", time() + 60*60*24);
These cookies are only available in $_COOKIE when the next document is requested by the web server. Forwarding using header() is ruled out due to the IIS bug (unless, of course, you know that your application never needs to be installed on an IIS web server). ...
Read now
Unlock full access