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

Can I run php without xampp?

0 Answers  


How can we extract string 'abc.com' from a string "http://info@abc.com" using regular expression of PHP

6 Answers   Wipro,


What is the functionality of the functions strstr() and stristr()?

0 Answers  


What are the advantages of using php?

0 Answers  


Which function would you use to read a line of data from a file in php?

0 Answers  


What are the uses of php language?

0 Answers  


Explain me how to include a file to a php page?

0 Answers  


What is php programming used for?

0 Answers  


What is the difference between associative array and indexed array?

0 Answers  


How can I check if a value is already in an array?

3 Answers   Rushmore Consultancy,


What is the function to count elements in an array in PHP?

0 Answers  


How can we enable error reporting in php?

0 Answers  


Categories