Access CMS-Session
Posted: Mon Mar 10, 2014 4:05 pm
Is there a way to access CMSes Session?
I want to create an own Captcha...always having problems with the Captcha Modul to validate in the first attempt especially when I use it via ajax. Also no reload is possible as the Captcha Module provides a cached image.
Up to CMSmadesimple 1.9 I used in an own PHP-file the following Code to write my own variable for the Captcha:
# replace the outcome of __dir__ if in another directory
$dirname = '__dir__';
$session_key = substr(md5($dirname), 0,
;
@session_name('CMSSESSID' . $session_key);
session_start();
$_SESSION['kapt_number']=$mysecret;
(here follows the creation of the Captcha-Picture...)
And then a Veryfy - UDT in Formbuilder:
if ( $params['captcha'] == $_SESSION['kapt_number'] ){
return array(true);
}else {
return array(false, "Captcha neu eingeben");
}
In the UDT, I was able to access the Session and validate the form.
Now, I guess for security reasons not possible anymore. Is there another way?
I want to create an own Captcha...always having problems with the Captcha Modul to validate in the first attempt especially when I use it via ajax. Also no reload is possible as the Captcha Module provides a cached image.
Up to CMSmadesimple 1.9 I used in an own PHP-file the following Code to write my own variable for the Captcha:
# replace the outcome of __dir__ if in another directory
$dirname = '__dir__';
$session_key = substr(md5($dirname), 0,
@session_name('CMSSESSID' . $session_key);
session_start();
$_SESSION['kapt_number']=$mysecret;
(here follows the creation of the Captcha-Picture...)
And then a Veryfy - UDT in Formbuilder:
if ( $params['captcha'] == $_SESSION['kapt_number'] ){
return array(true);
}else {
return array(false, "Captcha neu eingeben");
}
In the UDT, I was able to access the Session and validate the form.
Now, I guess for security reasons not possible anymore. Is there another way?