myGully.com

myGully.com (https://mygully.com/index.php)
-   Programmierung (https://mygully.com/forumdisplay.php?f=67)
-   -   PHP-Problem mit Sessions (alle auslesen bzw. alle bis auf eine löschen) (https://mygully.com/showthread.php?t=1957114)

Kotkruemel 17.12.09 08:49

PHP-Problem mit Sessions (alle auslesen bzw. alle bis auf eine löschen)
 
Hallo zusammen,

also wie im Titel schon zu lesen, will ich alle Sessions löschen, bis auf die Anmeldesession. Da ich jetzt nicht jede einzelne auflisten bzw. cookies erstellen wollte, hab ich mir gedacht frag ich besser nochmal nach...

also bisher hab ich halt nur
PHP-Code:

session_destroy(); 

und
PHP-Code:

unset($_SESSION['...']); 

gefunden...

vllt fällt euch ja noch was ein

vielen dank

gruß kotkruemel ;)

achistyle 17.12.09 14:16

Würd einfach nen array reinhauen xD

$_SESSION = array();

Dem kannst ja dann noch einen vorherigen Session wert mitgeben xD

urga 17.12.09 18:32

je nach dem wo der server die sessions speichert ....
wenn es im filesystem ist, hilft evntl. das hier weiter:
Code:

function DeleteSessionID($sessionid) {
  $orgpath = getcwd();
  chdir(PHP_BINDIR);
  chdir(session_save_path());
  $path = realpath(getcwd()).'/';
  if(file_exists($path.'sess_'.$sessionid)) {
    // Delete it here
    unlink($path.'sess_'.$sessionid);
  } else {
    // File not found
  }
  chdir($orgpath);
}

für alle sessions müsstest du eben alle session dateien löschen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:31 Uhr.

Powered by vBulletin® (Deutsch)
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.