|
session_start(PHP 4, PHP 5) session_start — Initialize session data Описание
bool session_start
( void
)
session_start() creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie. To use a named session, call session_name() before calling session_start(). When session.use_trans_sid is enabled, the session_start() function will register an internal output handler for URL rewriting. If a user uses ob_gzhandler or similar with ob_start(), the function order is important for proper output. For example, ob_gzhandler must be registered before starting the session. Возвращаемые значенияThis function returns TRUE if a session was successfully started, otherwise FALSE. Список изменений
Примеры
Пример #1 A session example: page1.php
<?php After viewing page1.php, the second page page2.php will magically contain the session data. Read the session reference for information on propagating session ids as it, for example, explains what the constant SID is all about.
Пример #2 A session example: page2.php
<?php Примечания
Смотрите также
|
|||||||