large cookie error

I have a controller method that processes data submitted from a form,
one item of which is a large file. This method gives me the following
error:

CGI::Session::CookieStore::CookieOverflow

I understand the source of the error is the cookie being too large but
what confuses me is no where in the controller do I directly touch the
session. Obviously something is getting put in the session but I
don't know what or how. Does rails push any controller objects into
the session by default?

thanks in advance,

john

I have a controller method that processes data submitted from a form,
one item of which is a large file. This method gives me the following
error:

CGI::Session::CookieStore::CookieOverflow

I understand the source of the error is the cookie being too large but
what confuses me is no where in the controller do I directly touch the
session. Obviously something is getting put in the session but I
don't know what or how. Does rails push any controller objects into
the session by default?

The flash is stored in the session but that's about that. What does
your controller look like ?

Fred

I switched to database session store and the problem went away but I'm
still curious as to why it occurred in the first place.

Here's my action. There are no calls to any other controller
methods. In fact search for "session" shows it does not occur
anywhere in my controller. My controller inherits from
ApplicationController so there's nothing else added by me.

def create
    @maid=Maid.new(params[:maid])
    design=Design.new(:design=>params[:genbank_file].readlines.join)
    @maid.designs<<design
    strategy=Strategy.find(params[:strategy_id])
    maid_strategy=case
       when strategy==Strategy.PCR: PCR.new(:strategy=>strategy)
       when strategy==Strategy.PCRtm: PCRTM.new(:strategy=>strategy)
       when strategy==Strategy.GSD: GSD.new(:strategy=>strategy)
       when strategy==Strategy.GSDtm: GSDTM.new(:strategy=>strategy)
       end
    maid_strategy.maid=@maid
    maid_strategy.design=design
    maid_strategy.deletion_desc=params[:deletion_desc]
    @strategies=Strategy.find(:all)
    if maid_strategy.save
      flash[:notice]='Design has been saved.'
      @maid=Maid.new
    else
      flash[:notice]="Error saving design."
      render :action=>'new' and return
    end
    render :action=>'new'
  end

I should also add my 'new' action is just:

def new
    @strategies=Strategy.find(:all)
end

I switched to database session store and the problem went away but I'm
still curious as to why it occurred in the first place.

database session stores don't have the same size limit (cookies are
limited to 4k)

Here's my action. There are no calls to any other controller
methods. In fact search for "session" shows it does not occur
anywhere in my controller. My controller inherits from
ApplicationController so there's nothing else added by me.

Doesn't seem to be much there. The problem could conceivably be
elsewhere in the app (ie something else makes the session nearly full,
and then the small amount of data added to the flash in this action
tips you over the edge)

Fred

Searching through my code, I don't touch the session anywhere except
for authentication actions which I currently have deactivated anyway,
plus they are only storing a user_id, not an object.

the file I'm uploading is about 700kb. The processing creates a large
object graph which is then saved to the db. Nowhere does it touch the
session, from what I can tell. I guess I'll just stick with db
session store for now. Weird...

thanks for the input.

John

Searching through my code, I don't touch the session anywhere except
for authentication actions which I currently have deactivated anyway,
plus they are only storing a user_id, not an object.

the file I'm uploading is about 700kb. The processing creates a large
object graph which is then saved to the db. Nowhere does it touch the
session, from what I can tell. I guess I'll just stick with db
session store for now. Weird...

thanks for the input.

Might be worth dumping the contents of the session to the page or
something - once you can see what it is that is taking up all the
space I would hope that it would be easy to work out who is putting it
there.

Fred