How can we destroy the session, how can we unset the
variable of a session?

Answer Posted / pawan chhabra

// Create a logout.php file then..

<?php
session_start();
header("location:login.php");
session_destroy();
??

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to check whether a number is prime or not?

755


Explain soundex() and metaphone().

786


Is php 5 still supported?

700


Differences between get, post and request methods ?

747


Where session is stored?

742


List functions available to sort an php array?

747


Can we set session value in javascript?

748


What is the difference between for and foreach loop in php?

852


Why is php so popular?

705


Explain what are psrs? Choose 1 and briefly describe it?

728


What is the difference between overloading and overriding in php?

760


Which functions are used to count the total number of array elements in php?

781


Tell me in php, objects are they passed by value or by reference?

753


What are the main error types in php and how do they differ?

1064


Differentiate between php5 and php7?

824