Skip to content
Advertisement

how to delete/destroy/unset a specific php session

I need to delete/destroy/unset a specific session

JavaScript

pro.php

JavaScript

echo $_SESSION['id'] on main page always gives me a value

here – How do I destroy a specific session variable in PHP? unset($_SESSION['id']) is accepted answer, but I tried so many times – doesn’t work

Advertisement

Answer

The unset method itself does the trick but until the page is refreshed it echo the last instance. you can try this

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement