I have curl to the function initialized session 1 with the element to transfer from curl, but at this function cannot re initialize new session 1 with the key and value got from curl. However when I execute F5 at the link link which curl call to which is not over curl, still initialized session, please make me
public function createSession(){
$params = $request->all();
$key = uniqid();
$request->session()->put($key, $params);
return response()->json([
'success' => true,
'key' => $key,
]);
}
Curl:
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, count($params));
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); // Time out 60s
curl_setopt($ch, CURLOPT_TIMEOUT, 60); // connect time out 60s
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (curl_error($ch)) {
return false;
}
if ($status != 200) {
curl_close($ch);
return false;
}
// close curl
curl_close($ch);
return json_decode($result);