![]() |
register_globals и сессии
Помогите разобраться с этим чудом РНР-строения :)
Собственно каким макаром мне обращать на чтение/запись к переменным сессии при вырубленом register_globals? Как к $_SESSION["var"] или $var? И можно ли работать с $_SESSION при включеном онном? |
а что, чтение мануалов уже не модно?
|
В том то и дело что "модно". Во _всех_ мануалах которые есть у меня описана работа через session_register(), а мне надо через $_SESSION! Если есть толковый ман - ткните носом :)
|
все просто. делаешь
PHP код:
|
вот выдержки из MAN:
Caution: If you want your script to work regardless of register_globals, you need to instead use the $_SESSION array as $_SESSION entries are automatically registered. If your script uses session_register(), it will not work in environments where the PHP directive register_globals is disabled. register_globals: important note: Since PHP 4.2.0, the default value for the PHP directive register_globals is off. The PHP community encourages all to not rely on this directive but instead use other means, such as the superglobals. Caution: This registers a global variable. If you want to register a session variable from within a function, you need to make sure to make it global using the global keyword or the $GLOBALS[] array, or use the special session arrays as noted below. Caution: If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered(), and session_unregister(). |
Про сессии на нармальном языке
а насчет печенек можешь небеспокоится если у юзверей они не устанавливаются php сам дорисовывает куда надо идентефикаторы сессии |
2 Sych Благодарствую, дотуркал что к чему, работает :)
|
| Часовой пояс GMT +4, время: 08:09. |
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.