I was testing Laravel 5.1's session feature in WAMP, following those steps:
First, composer create-proejct laravel/laravel laravel5.1 --prefer-dist
Second, in routes.php, I added Route::get('/testsession', 'TestSessionController@index');
Third, in TestSessionController.php, I added the following:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Session;
class TestSessionController extends Controller
{
//
public function index()
{
Session::set('aa', 'bb');
var_dump(Session::get('aa'));
}
}
I first run the application, and it outputted string 'bb' (length=2). Then I commented Session::set('aa', 'bb'); and run again, and it outputted null.
Is there something wrong? (Sorry about the formating)