[Flow] Creating simple UnitTests (RestController)

Robert Berghegger r_berghegger at web.de
Thu Apr 3 13:17:33 CEST 2014


Hello Peter,

i don't know what exactly you are trying to achieve but please notice 
that there is no constant "session" in a REST-based webservice.

Stateless communication is one of the main principles of the 
REST-architecture.
Each request stands for its own.

As a result you have to either create a new ressource wich contains 
"session" data and is persisted until it gets invalidated or you have to 
handle the session in your client.

I hope i told you something new and helpfull.

regards

Robert


Am 03.04.2014 12:18, schrieb Peter R:
> Hello Christian,
>
> how can I keep the session id alive?
> Everytime  when I  doing something like:
> $request = Request::create(new Uri('http://localhost/api/v1/auth'), 
> 'POST');
> $response = $this->browser->sendRequest($request);
>
> $request = Request::create(new 
> Uri('http://localhost/api/v1/standard'), 'GET');
> $request->setHeader('SessionId', $response->getContent());
> $response = $this->browser->sendRequest($request);
>
> The second request should have the same session like in the first one, 
> but a new started and this is bad.
>
> Peter
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow



More information about the Flow mailing list