Benjamin Cabé
2006-May-12 21:28 UTC
[Rails] Choosing not to save @session in a given controller or action ?
Hi ! All is in subject. In fact ? but I may make things wrong ? since I?ve deployed my rails app on an Apache/FastCGI with 3 ruby processes I encounter a problem. In my application, an applet requests a lot of thumbnails to the webserver. Serving these thumbnails need to read some variables in my @session. My problem occurs when, in my website (the one which contains the applet) I decide to change the content of my applet. I make another request to the webserver. This one is served by another of the two remaining instances of ruby; and writes some (important, of course) values in @session. But the other instance of ruby was in the middle of the action that return a given thumbnail. So when it ends, it writes the @session as it read it at its beginning (with no modification since it doesn?t make any). So the @session variable is totally broken for my next calls to ?get_thumbnail? because the @session modification that I thougt I made has been overwritten Does anybody know if (except if my design is really a bad idea ? ? i.e. using @session that way) it?s possible, to tell a controller or an action not to ?close_session? at its end ? (but of course I don?t want to totally disable session for that controller/action, because I need to read @session ) Thanks in advance, Benjamin (from France :op) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060512/d1854419/attachment.html
Benjamin Cabé
2006-May-15 05:07 UTC
[Rails] Choosing not to save @session in a given controller oraction ?
No idea ? :-/ Any help would be *greatly* appreciated ! Thanks again, Benjamin. ________________________________________ De?: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] De la part de Benjamin Cab? Envoy??: vendredi 12 mai 2006 23:26 ??: rails@lists.rubyonrails.org Objet?: [Rails] Choosing not to save @session in a given controller oraction ? Hi?! All is in subject. In fact ? but I may make things wrong ? since I?ve deployed my rails app on an Apache/FastCGI with 3 ruby processes I encounter a problem. In my application, an applet requests a lot of thumbnails to the webserver. Serving these thumbnails need to read some variables in my @session. My problem occurs when, in my website (the one which contains the applet) I decide to change the content of my applet. I make another request to the webserver. This one is served by another of the two remaining instances of ruby; and writes some (important, of course) values in @session. But the other instance of ruby was in the middle of the action that return a given thumbnail. So when it ends, it writes the @session as it read it at its beginning (with no modification since it doesn?t make any). So the @session variable is totally broken for my next calls to ?get_thumbnail? because the @session modification that I thougt I made has been overwritten Does anybody know if (except if my design is really a bad idea ? ? i.e. using @session that way) it?s possible, to tell a controller or an action not to ?close_session? at its end ? (but of course I don?t want to totally disable session for that controller/action, because I need to read @session ) Thanks in advance, Benjamin (from France :op)
Mark Reginald James
2006-May-15 11:01 UTC
[Rails] Re: Choosing not to save @session in a given controller oraction ?
Benjamin Cab? wrote:> Does anybody know if (except if my design is really a bad idea ? ? i.e. > using @session that way) it?s possible, to tell a controller or an action > not to ?close_session? at its end ? (but of course I don?t want to totally > disable session for that controller/action, because I need to read > @session?)It looks like you can prevent the session being written by executing "session = nil" at the end of your action that is only doing session reads. -- We develop, watch us RoR, in numbers too big to ignore.