Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / sreenia

the better way of destroying a session is to first unset all
the values of $_SESSION variables individually, and then use
the session_destroy() function

Is This Answer Correct ?    17 Yes 6 No

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

Answer / devendrarjadav

session_destroy() function destroys all data registered to
current session. use unset function to destroy varible
specified with session. So to destroy $name registered with
session use unset($name) in your php script.

Is This Answer Correct ?    16 Yes 6 No

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

Answer / sri harsha

session can be destroyed by using session_destroy() function
and variable can be unset by unset($_session['name']).

Is This Answer Correct ?    11 Yes 3 No

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

Answer / murali

session can be destroyed by using session_destroy() function
and variable can be unset by unset($_session['name']), and
also write like this...
$_session['name']=='';
you can assign null.

Is This Answer Correct ?    5 Yes 0 No

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

Answer / 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

More PHP Interview Questions

What is the basic syntax of Php?

0 Answers  


How to create the PHP Script to Calculate the Age Using the Inputs Of our Birth date and the Current date?

6 Answers  


What is the difference between the include() and require() functions?

0 Answers  


What is deffience betwwen get() , Post , Request()

3 Answers  


What does $_server means?

0 Answers  


How many functions are there in php?

0 Answers  


What is a stored procedure in mysql?

0 Answers  


Tell me what is the use of the function htmlentities?

0 Answers  


What are the different filter functions used to filter a variable?

0 Answers  


Which is best framework for php?

0 Answers  


How does csrf attack work?

0 Answers  


What is use of htmlspecialchars php?

0 Answers  


Categories