O
O
Optimus2015-11-18 19:25:59
PHP
Optimus, 2015-11-18 19:25:59

Entangled in sessions, untangle me?

Logging in to the site shows:

$_SESSION["UserName"] // имя сессии есть допустим ivan
$_COOKIE["Test"] // имя кук есть допустим mysite.com

I go through the exit page (question: did I do it right? )
// Уничтожаем сессию
if(isset($_SESSION["UserName"])){
    session_destroy();
}
// Удаляем Cookie
SetCookie("Test","");

Now:
var_dump($_SESSION);
var_dump($_COOKIE);

The first one shows Undefined variable
The second one shows:
array(1) {
  ["PHPSESSID"]=>
  string(26) "ra7emp6j6vp6o85oqlclefi315"

I left, what is PHPSESSID and why does it remain? There is no decryption here php.net/manual/ru/reserved.variables.cookies.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
My joy, 2015-11-18
Pyan @marrk2

PHPSESSID is a standard cookie - the key, provided that you have session_destroy somewhere in the code above, session_start();
you did it, it was deleted, but the key to it remained in the cookie. either delete it like test or check it is not called somewhere there (which you didn’t show here)session_start

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question