0

419 Sorry, your session has expired. Please refresh and try again. error after submitting my form (the form is too long soo this is just a part of it ) i'll post more if needed

  <form method="POST" action="{{action('inscriController@store') }}"id="deposeform"  >
                        {{ csrf_field() }}   
      <div class="buttons">
                                <button type="button" class="btn btn-alt js-reset"><i class="fa fa-refresh" style="font-size:24px"></i></button>
                                 <button type="button" name="prev" id="prev" class="btn" ><i class="fa fa-arrow-circle-left" style="font-size:24px"></i></button>

                                 <button type="submit" name="suiv" id="suiv5" placeholder="submit" class="btn"><i class="fa fa-arrow-circle-right" style="font-size:24px"></i></button>
                     </div>                

and my contoller

  public function store(Request $request)
    {
       $this->validate($request,[
        'Cin' => 'required',
        'username'=> 'required',
        'prenom'=> 'required',
        'email'=> 'required',
        'telephone'=> 'required',
        'specialite'=> 'required',
        'communication'=> 'required',
        'publication'=> 'required',
        'experiencePedagogiqueSecondaire'=> 'required',
        'experiencePedagogiqueSupérieur'=> 'required' 
       ]);
mohamed lahsoumi
  • 735
  • 1
  • 5
  • 12
  • i just wanted to add that i have tried these solutions in my terminal : php artisan key:generate php artisan config:cache php artisan cache:clear – mohamed lahsoumi Apr 15 '19 at 02:14
  • Are session variables used in your script? If so, did you start a session on every page? Difficult to diagnose without full code. – Vbudo Apr 15 '19 at 02:53
  • Possible duplicate of [Post request in Laravel 5.7, laravel 5.8 --- Error - 419 Sorry, your session has expired](https://stackoverflow.com/questions/52583886/post-request-in-laravel-5-7-laravel-5-8-error-419-sorry-your-session-has) – Milind Patel Apr 15 '19 at 05:37
  • you are missing csrf token so add ```@csrf``` inside your ```form``` tag – ManojKiran A Apr 15 '19 at 05:57
  • how are you saving in the controller as I can't see any model usage to save the data, you're just validating it. – guruprasad ks Apr 15 '19 at 12:51
  • i added the @csrf token and still same error 419 the code works fine with the get method soo i guess the error is with the post method – mohamed lahsoumi Apr 21 '19 at 18:44

0 Answers0