php - Laravel - Issue in getting session value

I have used the below code. For saving session - Session::put('seval', $val);

For fetching data from session-

{{ session()->get('seval') }}

This is what I am using but seems the issue is somewhere else. Is there any option to enable /disable session in configuration files? session is working on same page but when I click on some button that redirects to next page, session value disappears. Can anyone help me to find out where the issue is?

Answer

Solution:

The correct syntax for this is...

    Session::set('variableName', $value);

For Laravel 5.4 and later, the correct method to use is put.

    Session::put('variableName', $value);

To get the variable, you'd use...

    Session::get('variableName');

Source