[Flow] TYPO3 Flow Session Management
Matthias Secker
secker at alto.de
Fri Mar 21 14:37:14 CET 2014
Tried both tips, unfortunately they do not solve the problem.
After further investigation I think it is more kind of a cookie problem.
I expect a cookie named "TYPO3_Flow_Session" (Flow's standard) but my
Web Developer Toolbar says, it does not exist.
Even a simple example in a basic indexAction won't work:
$cookie = new \TYPO3\Flow\Http\Cookie("mytest", "myvalue");
$this->response->setCookie($cookie);
I do not get a error message, but if I try to read the cookie in another
action it fails:
$cookie = $this->request->getHttpRequest->getCookie("mytest");
echo $cookie->getValue();
getValue() is a call on a non-object. Seems like the cookie was never
written. I also use a Flow 2.0.0 on a MAMP with a very basic package
(Flow.Welcome), so there are no Aspect-Classes or other things.
Any ideas?
Am 19.03.2014 17:39, schrieb Matthias Secker:
> Hi everyone!
>
> I got alot of trouble with Flow's Session-Management. I use FLOW 2.1. In
> my Settings I don't set specific cache/sesion options so the standard
> configuration should be set.
>
>
> In my simple controller I inject \TYPO3\Flow\Session\SessionInterface
> for testing purposes:
>
> /**
> * @var \TYPO3\Flow\Session\SessionInterface
> * @Flow\Inject
> *
> */
> protected $session;
>
>
> So my indexAction can perform short test
>
>
> $this->session->start();
> $x = $this->session->getData('test');
> if (empty($x)) {
> $x = 1;
> } else {
> $x++;
> }
>
> $this->session->putData('test', $x);
> echo "ID:" . $this->session->getId();
> echo $x;
>
> Of course this is a low level session test, but I also have trouble with
> securityContext, Login/Auth and Scope/Session.
>
> I watched the getId() (SessionId?), it changes on every page reload. The
> cookie "TYPO3_Flow_Session" seems not to be set or randomly.
> It looks like flow starts a new session most time. That may be the
> reason why securityContent can't deliver my Party (own User Model),
> although the AuthProvider said SUCCESSFUL.
>
> The cache files will be written to
> .....Data/Temporary/Development/Cache/Data/Flow_Session_Storage, but a
> new file for each page reload.
>
> Any ideas?
> Thanks in advance.
>
More information about the Flow
mailing list