i have some problem, I'm creating apps for commerce, and the cart is work, but when I'm reloading the pages, the session is gone, cart, and other.
here's my code
//show product page
$scope.showProductInfo=function (id,desc,img,name,price) {
sessionStorage.setItem('product_info_id', id);
sessionStorage.setItem('product_info_desc', desc);
sessionStorage.setItem('product_info_img', img);
sessionStorage.setItem('product_info_name', name);
sessionStorage.setItem('product_info_price', price);
window.location.href = "/#/page8";
};
//add to cart function
$scope.addToCart=function(id,image,name,price){
cart.add(id,image,name,price,1);
};
how can i save the data to session or cookies, like php did, so if the reloading page, the session not destroying/ session_destroy();
hope somebody care enough to help me