I try to realize shopping cart, and i wrote this code:
if cookies[:shopping_cart]
Cart.find(cookies[:shopping_cart][:value])
else
cookies[:test] = 'tt'
cart = Cart.create
cookies[:shopping_cart] = {
:value => cart.id,
:expires => 1.week.from_now.utc,
:path => '/',
:domain => 'localhost:3000'
}
end
But every time i have cookies[:shopping_cart] nil, and every time my "code" try to create new cookies[:shopping_cart].
cookies[:test] also equal nil every time.
that suggest?