I have developed a laravel 5 app which is working well on all other browsers except IE and Edge. I am getting TokenMismatchException on all form submits. I read this blog http://ift.tt/2bAKtF7
and implemented the following as an attempt to solve the issue but it still not working:
-
Created a Middleware
namespace App\Http\Middleware; use Closure; class IeFix { /** * Handle an incoming request. Fix session error with Laravel on IE/Edge * * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $response = $next($request); $response->header('P3P', 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'); return $response; } }
- Added the class to the application's global HTTP middleware stack like below.
protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, \App\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \App\Http\Middleware\IeFix::class, ];
But I still get same error on IE and Edge? What can I do to fix this?
- Added the class to the application's global HTTP middleware stack like below.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire