title: laravel app before session
body: <p>I'm using php laravel framework, I want to set the prefix of route group by session:</p>
  
  <pre><code>App::before(function(){
      Session::put('lang', Request::segment(1));
  });
  
  Route::group(array('prefix' =&gt; Session::get('lang')), function(){
      //home
      Route::get('/', array('as' =&gt; 'home', 'uses' =&gt; 'IndexController@index'));
      //login
      Route::get('/login', array('as' =&gt; 'login', 'uses' =&gt; 'UserController@login'));
      Route::post('/do-login', array('as' =&gt; 'do_login', 'uses' =&gt; 'UserController@doLogin'));
      Route::get('/logout', array('as' =&gt; 'logout', 'uses' =&gt; 'UserController@logout'));
  });
  </code></pre>
  
  <p>The default url of login is: localhost:9090/en/login. But if I change 'en' to 'zh'(or something else) the application threw 'Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException' exception. 
  I then refresh the changed url(localhost:9090/zh/login), the page shows correctly.</p>
  
  <p>What's wrong with it?</p>