I have a wired problem. Im put some string / object into the session, and when I want to get it, it is not.
This is the code:
class CartController extends \BaseController
{
public function index()
{
return Session::all();
}
public function store()
{
Session::put('items', Input::get('items'));
}
}
in angular:
this.saveItemsToSession = function() {
$http.post('cart', {
items: 'test even string'
});
};
What can cause this problem?
Session does not seem to work. This method works:
session_start();
class CartController extends \BaseController
{
public function index()
{
return $_SESSION['items'];
}
public function store()
{
$_SESSION['items'] = Input::get('items');
}
}
user4207046
source
share