On the real hosting when I go to the admin area after 1-2 min larevel block all my site with ERR_TOO_MANY_REDIRECTS. Laravel sends 2 cookies (XSRF-TOKEN and laravel_session) and when I delete this cookie all work again. What is this? This is not end of session because session lifetime 120 min.
my code.
route
//adnin panel
// Authentication Routes...
Route::get('login', 'Auth\AuthController@showLoginForm');
Route::post('login', 'Auth\AuthController@login');
Route::get('logout', 'Auth\AuthController@logout');
Route::group(['prefix' => 'office', 'middleware' => ['auth', 'admin']], function (){
//orders
Route::get('orders', ['as' => 'orders', 'uses' => 'AdminControllerOrder@showOrders']);
Route::get('orders/{date}', ['as' => 'orders_date', 'uses' => 'AdminControllerOrder@showOrdersForDate']);
Route::get('order/{id}', ['as' => 'order_one', 'uses' => 'AdminControllerOrder@showOneOrders']);
Route::post('order/{id}', ['as' => 'order_one', 'uses' => 'AdminControllerOrder@editOneOrders']);
//prices
Route::get('prices', ['as' => 'prices', 'uses' => 'AdminControllerPrices@showPrices']);
Route::get('prices/{type}', ['as' => 'prices_edit', 'uses' => 'AdminControllerPrices@editTypePrices']);
Route::post('prices/{type}', ['as' => 'prices_edit', 'uses' => 'AdminControllerPrices@updateTypePrices']);
//buyers
Route::get('buyers', ['as' => 'buyers', 'uses' => 'AdminControllerBuyers@showBuyers']);
//download_Images
Route::get('down_load_img/{path}', ['as' => 'down_load', 'uses' => 'AdminControllerBuyers@downLoadImg']);
});
admin middleware
class AdminMiddleware
{
public function handle($request, Closure $next)
{
if (Auth::user()->role === 'boss') {
return $next($request);
}
return response()->view('errors/404');
}
}