php - Unsetting cookies and sessions

289

I want to unset the cookie and session but can't. My Code

<?php
session_start();
unset($_SESSION["SRAUSERNAME"]);
unset($_SESSION["SRAPASSWORD"]);
unset($_COOKIE["RAUSERNAME"]);
unset($_COOKIE["RAPASSWORD"]);
setcookie("RAUSERNAME","",time() -60*60);
setcookie("RAPASSWORD","",time() -60*60);
header("location: ../");
?>

The Sessions has been unset-ted but cookies is not. Why?

People are also looking for solutions to the problem: php - Laravel 5.4 - integration testing role middleware fails

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.