Cookies are not saved


I'm developing my first RoR application and working first time with
cookies on RoR.

I create a product object, save it and set the id into the cookie

  def create
    @image =[:image])

    respond_to do |format|
        @product =
        @product.image_id =
        @product.order_id =
        cookies[:product_id] =
        flash[:notice] = 'Image was successfully created.'
        format.html {redirect_to('/karte/waehlen')}
        format.xml { render :xml => @image, :status => :created,
:location => @image }
        format.html { render :action => "new" }
        format.xml { render :xml => @image.errors, :status =>
:unprocessable_entity }

Then I redirect to the "karte" controller and "waehlen" action

The karte controller looks like this

class KarteController < ApplicationController
    def waehlen
      @product = Product.find(cookies[:product_id])
      @image = Image.find(@product.image_id)

I try to get the product_id from the cookie.

The waehlen.html.erb looks like

<div id="formatCenterContainer">
  <%= image_tag(@image.filename, :size => "190x153") %>

I get a NoMethodError

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.filename

Extracted source (around line #12):

10: </div>
11: <div id="formatCenterContainer">
12: <%= image_tag(@image.filename, :size => "190x153") %>

I checked the Cookie folder on my filesystem. There is no Cookie.

Do I have activate cookies? I already browsed for the problem, but I
find only information about read/write cookies and other options.

Cheers Adam