are you using Laravel 5.2? Does your route include the 'web' middleware group? If not the sessions may not be available
Jan 10, 2016
4
Level 1
L5 session put not working
hi,
I dont get why I cant create a session variable using this code :
public function commitTransaction($cluster,$transId)
{
try {
$response = $this->client->request('PUT', 'https://' . $cluster . '/' . $transId, [
'auth' => ['id', 'pass'],
'proxy' => '',
'verify' => false,
'json' => [
'state' => 'VALIDATING'
]
]);
$res = $response->getBody()->getContents();
session()->put('commit',$res);
}
catch (RequestException $e){
var_dump($e->getResponse()->getBody()->getContents());
}
}
Thanks for your help.
Please or to participate in this conversation.