Answer the question
In order to leave comments, you need to log in
Session + joomla - what's the problem?
Good afternoon.
Joomla.
There is a script that displays the captcha.
Please help me sort out the sessions in this situation.
1) if it's easy to do
//////////captcha.php
session_start();
$rand = 15;
$_SESSION["rand"] = $rand;
//////////form.php
session_start();
<img src = "QAmodule/captcha.php">
var_dump($_SESSION['rand']);
//////////captcha.php
define('BASE_PATH',$_SERVER["DOCUMENT_ROOT"]);
require_once BASE_PATH.'/includes/defines.php';
require_once BASE_PATH.'/includes/framework.php';
define( '_JEXEC', 1 )
$rand = 15;
$session = JFactory::getSession();
$session->set( 'randStr', $rand );
Answer the question
In order to leave comments, you need to log in
Joomla and many other engines use their own session mechanism, not related to the $_SESSION array. Use the Joomla API to create sessions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question