Skip to main content
added 8 characters in body
Source Link
Joe P
  • 541
  • 1
  • 3
  • 13

I finally worked it out. I needed to create a session and assign it to the app before getFormToken would work. So first I use the Joomla session:

use Joomla\Session\Session;

Then create the session, set it and get the form token:

$session = Session::getInstance('none');
$this->app->setSession($session);
$token = $this->app->getFormToken();

Easy when you know how! I hope this helps someone else.

I finally worked it out. I needed to create a session and assign it to the app before getFormToken would work. So first I use the Joomla session:

use Joomla\Session\Session;

Then create session, set it and get form token:

$session = Session::getInstance('none');
$this->app->setSession($session);
$token = $this->app->getFormToken();

Easy when you know how! I hope this helps someone else.

I finally worked it out. I needed to create a session and assign it to the app before getFormToken would work. So first I use the Joomla session:

use Joomla\Session\Session;

Then create the session, set it and get the form token:

$session = Session::getInstance('none');
$this->app->setSession($session);
$token = $this->app->getFormToken();

Easy when you know how! I hope this helps someone else.

deleted 11 characters in body
Source Link
Joe P
  • 541
  • 1
  • 3
  • 13

I finally worked it out. I needed to create a session and assign it to the app before getFormToken would work. So first I use the Joomla session:

use Joomla\Session\Session as Session;Joomla\Session\Session;

Then create session, set it and get form token:

$session = Session::getInstance('none');
$this->app->setSession($session);
$token = $this->app->getFormToken();

Easy when you know how! I hope this helps someone else.

I finally worked it out. I needed to create a session and assign it to the app before getFormToken would work. So first I use the Joomla session:

use Joomla\Session\Session as Session;

Then create session, set it and get form token:

$session = Session::getInstance('none');
$this->app->setSession($session);
$token = $this->app->getFormToken();

Easy when you know how! I hope this helps someone else.

I finally worked it out. I needed to create a session and assign it to the app before getFormToken would work. So first I use the Joomla session:

use Joomla\Session\Session;

Then create session, set it and get form token:

$session = Session::getInstance('none');
$this->app->setSession($session);
$token = $this->app->getFormToken();

Easy when you know how! I hope this helps someone else.

Source Link
Joe P
  • 541
  • 1
  • 3
  • 13

I finally worked it out. I needed to create a session and assign it to the app before getFormToken would work. So first I use the Joomla session:

use Joomla\Session\Session as Session;

Then create session, set it and get form token:

$session = Session::getInstance('none');
$this->app->setSession($session);
$token = $this->app->getFormToken();

Easy when you know how! I hope this helps someone else.