In PHP, session data is usually stored in a file. The only thing stored in the cookie is the session identifier. When sessions are turned on and a valid session cookie is found, PHP loads the user's session data from the file into a super global one, which is called quite funny. SESSION.
Basic sessions begin with a session_start();call that is called before any text is sent to the browser. then elements are added or removed from the session object using simple indexing of the array, for example.
$_SESSION['favcolour'] = 'blue';
later...
$favcolour = $_SESSION['favcolour'];
only basic cookie sessions (without local storage) can be created with a call
set_cookie('favcolour','blue'[,other params]);
before any text is sent to the browser and then extracted from the superglobal cookie
$favcolour = $_COOKIE['favcolour'];
you do not need to call session_start()if you only make cookie sessions.
[, ] http://www.php.net/manual/en/function.setcookie.php
, , .
DC
, - PHP
http://www.php.net/manual/en/book.session.php
DC
PHP, , session_set_save_handler, . , , - .
, set_cookie $_SESSION ( ) cookie. cookie, $_SESSION.
, , , cookie. - , , - .
DC