Hi, Im developing an application in Rails 2.02.
Everything seems to work fine but the problems begin when I try to put
some data in the session.
I have a model in proyect/models:
class Result
attr_accessor :names, :urls, :images
def initialize
@names = Array.new
@urls = Array.new
@images = Array.new
end
end
Controller:
@variable = Result.new
#code that fills up the values in the result arrays.
session[:result] = @result
I fill these attributes from a controller. At the end, if I try to put
the variable into the session I get the msg:
Status: 500 Internal Server Error Content-Type: text/html
500 Internal Server Error
Any ideas? thanks!
--~--~---------~--~----~------------~-------~--~----~
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 24 Dec 2007, at 12:58, Javier Quevedo wrote:> > Hi, Im developing an application in Rails 2.02. > Everything seems to work fine but the problems begin when I try to put > some data in the session. > > I have a model in proyect/models: > > class Result > attr_accessor :names, :urls, :images > def initialize > @names = Array.new > @urls = Array.new > @images = Array.new > end > end > > Controller: > @variable = Result.new > #code that fills up the values in the result arrays. > session[:result] = @result > > I fill these attributes from a controller. At the end, if I try to put > the variable into the session I get the msg: >There should be a full stack trace in your log files. Are you putting anything unserializable in your session? Fred> Status: 500 Internal Server Error Content-Type: text/html > 500 Internal Server Error > > > Any ideas? thanks! > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
This is the trace of the log
Rendering /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/templates/rescues/layout.erb (internal_server_error)
/!\ FAILSAFE /!\ Mon Dec 24 14:19:02 +0100 2007
Status: 500 Internal Server Error
CGI::Session::CookieStore::CookieOverflow
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
session/cookie_store.rb:112:in `close''
Is it too big what I''m trying to store in the session?
On Dec 24, 1:58 pm, Javier Quevedo
<jquev...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi, Im developing an application in Rails 2.02.
> Everything seems to work fine but the problems begin when I try to put
> some data in the session.
>
> I have a model in proyect/models:
>
> class Result
> attr_accessor :names, :urls, :images
> def initialize
> @names = Array.new
> @urls = Array.new
> @images = Array.new
> end
> end
>
> Controller:
> @variable = Result.new
> #code that fills up the values in the result arrays.
> session[:result] = @result
>
> I fill these attributes from a controller. At the end, if I try to put
> the variable into the session I get the msg:
>
> Status: 500 Internal Server Error Content-Type: text/html
> 500 Internal Server Error
>
> Any ideas? thanks!
--~--~---------~--~----~------------~-------~--~----~
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 Dec 24, 2007, at 2:20 PM, Javier Quevedo wrote:> Rendering /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/templates/rescues/layout.erb (internal_server_error) > /!\ FAILSAFE /!\ Mon Dec 24 14:19:02 +0100 2007 > Status: 500 Internal Server Error > CGI::Session::CookieStore::CookieOverflow > /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ > session/cookie_store.rb:112:in `close'' > > Is it too big what I''m trying to store in the session?In your snippet there''s this comment: #code that fills up the values in the result arrays. I guess the resulting cookie value after you populate the inner arrays (think whole object tree marshalled + Base64 encoding + two dashes + digest) is > 4K. Do you really need such an object in the session. If yes then you''d need to switch to a different storage. -- fxn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks. I didn''t know that you could only store 4Kb in size in the session. I guess that I will use a database to store it then. Thanks for your fast reply! On Dec 24, 2:26 pm, Xavier Noria <f...-xlncskNFVEJBDgjK7y7TUQ@public.gmane.org> wrote:> On Dec 24, 2007, at 2:20 PM, Javier Quevedo wrote: > > > Rendering /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/ > > action_controller/templates/rescues/layout.erb (internal_server_error) > > /!\ FAILSAFE /!\ Mon Dec 24 14:19:02 +0100 2007 > > Status: 500 Internal Server Error > > CGI::Session::CookieStore::CookieOverflow > > /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ > > session/cookie_store.rb:112:in `close'' > > > Is it too big what I''m trying to store in the session? > > In your snippet there''s this comment: > > #code that fills up the values in the result arrays. > > I guess the resulting cookie value after you populate the inner arrays > (think whole object tree marshalled + Base64 encoding + two dashes + > digest) is > 4K. > > Do you really need such an object in the session. If yes then you''d > need to switch to a different storage. > > -- fxn--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---