Search

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.

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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details