Jump to content

[SOLVED] Destroy a Specific Session


chocopi

Recommended Posts

How do you destroy a specific session without damaging the others:

 

<?php
$id = $_SESSION['id'];
$username = $_SESSION['username'];
$password = $_SESSION['password'];
?>

 

How could i just destroy $id = $_SESSION['id']; ?

 

Thanks,

 

~ Chocopi

Link to comment
https://forums.phpfreaks.com/topic/53165-solved-destroy-a-specific-session/
Share on other sites

By "destroy a specific session" you mean "destroy one session variable"?

There is an example in the online docs

http://www.php.net/manual/en/ref.session.php

Example 2163.  Unregistering a variable with $_SESSION and register_globals disabled.

<?php

session_start();

// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less

unset($_SESSION['count']);

?>

  • 2 years later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.