$_COOKIE["PHPSESSID"] выдает NULL

Discussion in 'PHP' started by people2people, 6 Apr 2020.

  1. people2people

    people2people Banned

    Joined:
    1 Dec 2019
    Messages:
    167
    Likes Received:
    64
    Reputations:
    0
    Почему:
    Code:
    var_dump($_COOKIE["PHPSESSID"]);
    выдает:
    NULL
     
  2. 1n0y

    1n0y Active Member

    Joined:
    9 May 2009
    Messages:
    270
    Likes Received:
    268
    Reputations:
    2
    печаль
     
    Turanchocks_ likes this.
  3. ckpunmkug

    ckpunmkug Member

    Joined:
    20 Mar 2017
    Messages:
    58
    Likes Received:
    50
    Reputations:
    3
    NULL - признак отсутствия
    Code:
    var_dump(isset($_COOKIE["PHPSESSID"]));
    
     
  4. winstrool

    winstrool ~~*MasterBlind*~~

    Joined:
    6 Mar 2007
    Messages:
    1,417
    Likes Received:
    814
    Reputations:
    848
    что-бы там что-то было, надо туда что-то положить, например:
    PHP:
    setcookie("PHPSESSID"$PHPSESSID);
    Подробней можете почитать в мануале:
    https://www.php.net/manual/ru/function.setcookie.php
     
    _________________________
  5. people2people

    people2people Banned

    Joined:
    1 Dec 2019
    Messages:
    167
    Likes Received:
    64
    Reputations:
    0
  6. people2people

    people2people Banned

    Joined:
    1 Dec 2019
    Messages:
    167
    Likes Received:
    64
    Reputations:
    0
    А точнее так, при записи id рефералла сайта..
    Code:
    if (!session_id()) {
        ini_set('session.gc_maxlifetime', 10800);
        @session_cache_limiter('private, must-revalidate'); //private_no_expire
        @session_cache_expire(0);
        @session_set_cookie_params(3600);
        @session_start();
        }
    if (isset($_GET['ref'])) {
              $_SESSION['referall'] = (string) $_GET['ref'];
        }
     
Loading...