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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 3, 12:18 pm, jsikorski <john.sikor...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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> > thanks in advance, > > john--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I should also add my ''new'' action is just: def new @strategies=Strategy.find(:all) end On Oct 3, 8:00 am, jsikorski <john.sikor...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 3 Oct 2008, at 13:00, jsikorski wrote:> > 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> 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 > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On Oct 3, 8:17 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 3 Oct 2008, at 13:00, jsikorski wrote: > > > > > 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 > > > 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 3 Oct 2008, at 13:40, jsikorski wrote:> > 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> John > > On Oct 3, 8:17 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On 3 Oct 2008, at 13:00, jsikorski wrote: >> >> >> >>> 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 >> >>> 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 > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---