How to work with $_SESSIONS?
This is an open discussion with 4 replies, filed under General.
Search
In which context are you trying to use $_SESSION
?
i’d like to save keystring for captcha. so at file /extensions/kcaptcha/lib/kcaptcha.php:
$_SESSION[‘kcaptcha’] = “something”;
then i’d like to get it in /extensions/kcaptcha/events/event.kcaptcha.php:
protected function __trigger(){ $result = new XMLElement('kcaptcha'); $result->setAttribute("session-id", session_id()); $result->setAttribute("session-keystring", $_SESSION['kcaptcha']); return $result; }
and result:
<kcaptcha session-id=”3376ca8ecdf88df1ea2a79a1907ce892” session-keystring=”” />
Have a look at or try the reCaptcha and Session Monster extensions.
Ok. Now i can rephrase my question: Which code should be included in custom php file to get $_SESSION[‘any’] variable, defined in event ?
Create an account or sign in to comment.
Can anyone tell me how to add session vars? I tried to use $_SESSION[‘test’] = ‘ok’; but there is no result: i can’t get it in another page.