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

Why constructor is not overridden?

0 Answers  


What is difference between str_replace and substr_replace

1 Answers  


What is the best website to learn php?

0 Answers  


What is sql injection in php?

0 Answers  


how we can retrive data in pdf along php mysql?

2 Answers  


What do you mean by core php?

0 Answers  


What is the difference between the functions unlink and unset?

8 Answers   Small Firm, TCS,


What is echo and print in php?

0 Answers  


What is the use of mysqli_real_escape_string() function?

0 Answers  


What is the static variable in function useful for?

0 Answers  


Is it worth learning php in 2019?

0 Answers  


What are the advantages of indexes?

0 Answers  


Categories