leostereo
6 months ago
771
4
Laravel

Can not store session value.

Posted 6 months ago by leostereo

Hi guys , im running laravel 5.8. Im trying to set and get some session values but I got following message:

 RuntimeException
Session store not set on request.

This is my controller:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class SessionController extends Controller
{
    /**
     * Show the profile for the given user.
     *
     * @param  Request  $request
     * @param  int  $id
     * @return Response
     */
   public function storeSessionData(Request $request) {
        $value = $request->session()->put('key');

        //
    }
}

I did not tweak anything else.

Any ideas ? Leandro.

Please sign in or create an account to participate in this conversation.