I have a wired problem. Im put in session some string/object, and when i want to get it is not there.
This is the code:
class CartController extends \BaseController
{
public function index()
{
return Session::all(); // items is not there
}
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?
Its seems like Session dont work. This way is working:
session_start();
class CartController extends \BaseController
{
public function index()
{
return $_SESSION['items'];
}
public function store()
{
$_SESSION['items'] = Input::get('items');
}
}