[Flow] TYPO3 Flow Session Management

Matthias Secker matt2002 at gmx.de
Wed Mar 19 22:13:22 CET 2014


Thanks for your reply.

I don't think I ran into this bug because I use the version 2.1 so that 
should be fixed.
I know scope session classes are the prefered way but in tests even that 
fails, that's the reason why I tested the session framework on a low 
level base. Anyway, Flow will throw an exception if I do not use start() 
method on SessionInterface, I think that is necessary, but I don't know 
why it starts always a new session(ID)

I appreciate any helpful tips!


Am 19.03.2014 19:49, schrieb Christian Loock:
> Look at this Bug report:
> http://forge.typo3.org/issues/44202
>
> According to a comment there:
>
> The session is automatically resumed by the Bootstrap (calling resume())
> and if that was successful, calling start() at a later stage will be a
> noop. I'll add a description of that mechanism to the Script doc comment.
>
>
> Anyways, if you read the docs, you will see that it discourages you to
> handle your session by yourself. Instead you should just use the Object
> Scope Session. Further Information about this can be found here:
>
> http://docs.typo3.org/flow/TYPO3FlowDocumentation/TheDefinitiveGuide/PartIII/SessionHandling.html
>
>
> 2014-03-19 17:39 GMT+01:00 Matthias Secker <secker at alto.de>:
>
>> 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.
>>
>> _______________________________________________
>> Flow mailing list
>> Flow at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>>



More information about the Flow mailing list