Answer the question
In order to leave comments, you need to log in
Does deleting cookies not work?
The script for displaying cookies and its subsequent deletion does not work.
<?php if($_COOKIE["auth_reg_error"] != ''): ?>
<div class="input_errors" align="center">
<?php echo $_COOKIE["auth_reg_error"];
unset($_COOKIE["auth_reg_error"]);
setcookie("auth_reg_error", null, -3600, '/register/');
?>
</div>
<?php endif; ?>
Answer the question
In order to leave comments, you need to log in
Reading the official setcookie() documentation
setcookie() sets a cookie that will be sent to the client along with other HTTP headers. Like any other header, the cookie must be sent before any other script data is output (this is a protocol limitation). This means that in the script, calls to this function must be placed before the rest of the output , including the output of the and tags , as well as empty lines and whitespace characters.<html>
<head>
<?php if($_COOKIE["auth_reg_error"] != ''): ?>
<div class="input_errors" align="center">
<html>
<head>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question