Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.www.php > #21348

cookie in ambiente CLI

From alex <1j9448a02@lnx159sneakemail.com.invalid>
Newsgroups it.comp.www.php
Subject cookie in ambiente CLI
Date 2017-01-09 17:30 +0100
Organization Aioe.org NNTP Server
Message-ID <o50dqu$1oro$1@gioia.aioe.org> (permalink)

Show all headers | View raw


<?php // test.php
setcookie('id', 123);
echo $_COOKIE['id']."\n";
?>

Proviamo ad eseguirlo da terminale

$ php test.php
PHP Notice:  Undefined index: id in tesr.php on line 3

Visto che siamo in ambiente CLI non c'è da stupirsi dell'errore alla riga 3.
Ma allora perchè la funzione setcookie() non da nessun errore? Non 
dovrebbe essere in accordo.....  ???
Non è che il cookie 'id' viene memorizzato da qualche altra parte?

In pratica la domanda generale sarebbe: c'è un modo per testare i cookie 
in ambiente cli?

Back to it.comp.www.php | Previous | NextNext in thread | Find similar | Unroll thread


Thread

cookie in ambiente CLI alex <1j9448a02@lnx159sneakemail.com.invalid> - 2017-01-09 17:30 +0100
  Re: cookie in ambiente CLI fmassei@gmail.com - 2017-01-09 08:54 -0800
  Re: cookie in ambiente CLI Alessandro Pellizzari <shuriken@amiran.it> - 2017-01-09 18:56 +0000
    Re: cookie in ambiente CLI alex <1j9448a02@lnx159sneakemail.com.invalid> - 2017-01-11 11:37 +0100
      Re: cookie in ambiente CLI Alessandro Pellizzari <shuriken@amiran.it> - 2017-01-11 15:27 +0000

csiph-web