Welcome Guest, Not a member yet? Register   Sign In
Redirect Help
#11

The behavior of cookies is well documented in the PHP manual:

Code:
Common Pitfalls:

- Cookies will not become visible until the next loading of a page that the cookie should be visible for. To test if a cookie was successfully set, check for the cookie on a next loading page before the cookie expires. Expire time is set via the expires parameter. A nice way to debug the existence of cookies is by simply calling print_r($_COOKIE);.
- Cookies must be deleted with the same parameters as they were set with. If the value argument is an empty string, or false, and all other arguments match a previous call to setcookie, then the cookie with the specified name will be deleted from the remote client. This is internally achieved by setting value to 'deleted' and expiration time to one year in past.
- Because setting a cookie with a value of false will try to delete the cookie, you should not use boolean values. Instead, use 0 for false and 1 for true.
- Cookies names can be set as array names and will be available to your PHP scripts as arrays but separate cookies are stored on the user's system. Consider explode() to set one cookie with multiple names and values. It is not recommended to use serialize() for this purpose, because it can result in security holes.

Please read my replies to the cookie issues reported:

https://github.com/codeigniter4/CodeIgni...-766308246
https://github.com/codeigniter4/CodeIgni...-757625936
Reply




Theme © iAndrew 2016 - Forum software by © MyBB