Код: Выделить всё
public function getRemoteData (Request $r) {
$body_text = $this->buildBody();
$response = Illuminate\Support\Facades\Http::withHeaders([
'Authorization' => 'Basic ' . $user_info,
'Accept' => '*/*',
'Host' => config('remote_server'),
])->withBody (
$body_text, 'application/x-www-form-urlencoded'
)->post(config('request_url'));
// deal with auth failure reponse...
$my_data = $response->json('data');
$r->session()->put('MyData', $my_data);
Log::debug($r->session->all()); // 'MyData' key is included in the session here, visible in the logs
return redirect()->route('success');
}
Код: Выделить всё
public function Success (Request $r) {
dd ($r->session()->all()); // this debug does NOT include 'MyData' key
}
Код: Выделить всё
{
"response in json format": {
"access_token": "uutq...a03gHgemmw",
"expires_in": 3600,
"refresh_expires_in": 7200,
"refresh_token": "0Cql6f...DOg5mCY",
"token_type": "Bearer",
"id_token": "o6bgnx...XgKkXbQ",
"not-before-policy": 0,
"session_state": "c3fcd070-7fe9-4041-a6d0-16e9ff14757f",
"scope": "openid audience microprofile-jwt email profile"
}
}
Я только что заметил, что проблема, кажется, происходит только тогда, когда я устанавливаю session_driver = cookie . Если я установите session_driver = file , проблема исчезает !!
Что случилось с этим? Я тестирую свой веб-сайт через NPM запустить dev (с Vite, управляющим Hot-Update мои активы). Не уверен, будет ли это сыграть часть в этом? Я еще не нашел комбинацию, которая работает !!
Подробнее здесь: https://stackoverflow.com/questions/795 ... to-session