Sep
17
2010
session_regenerate_id()

session_regenerate_id

(PHP 4 >= 4.3.2, PHP 5)

session_regenerate_id --  Update the current session id with a newly generated one

Описание

bool session_regenerate_id ( [bool delete_old_session] )

session_regenerate_id() will replace the current session id with a new one, and keep the current session information.

Список параметров

delete_old_session

Whether to delete the old associated session file or not. Defaults to FALSE.

Возвращаемые значения

Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки.

Список изменений

ВерсияОписание
4.3.3 Since then, if session cookies are enabled, use of session_regenerate_id() will also submit a new session cookie with the new session id.
5.1.0 Added the delete_old_session parameter.

Примеры


<?php
session_start
();

$old_sessionid session_id();

session_regenerate_id();

$new_sessionid session_id();

echo 
"Old Session: $old_sessionid<br />";
echo 
"New Session: $new_sessionid<br />";

print_r($_SESSION);
?>

Смотрите также

session_id()
session_start()
session_name()

 
 
 
Комментарии
Добавить новый Поиск
Оставить комментарий
Имя:
Email:
 
Веб-сайт:
Тема:
UBB-Код:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Пожалуйста, введите проверочный код, который Вы видите на картинке.
Powered by !JoomlaComment 3.26

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 

Кто онлайн

Сейчас 36 гостей онлайн