Flash/Flex Remoting and Disabling Rails Sessions
The things that make web development with Ruby on Rails so easy, and dare I say fun, can also sometimes get in the way or cause unexpected problems (not fun). Rails sessions are generated automatically which is cool if you need sessions for say a shopping cart app. However if you don’t need sessions, or you want to handle data tracking in a different way with Flex/Flash’s Shared Objects, Rails will still chug along and output a session unless you tell it not to.
Here’s how to stop the session madness. Open up the WebORB controller and add this line ‘‘.
This is not Remoting specific and works for any controller in a Rails app. Rails sessions will keep multiplying like those furry things from that infamous Star Trek episode (Tribbles, thanks Google). eventually you’ll need a CRON job on your server to delete sessions from the tmp/sessions folder (or the database if you’re using ActiveRecord Store), so you might as well not create them in the first place and avoid a mess to clean up!
Here’s a good article on Rails sessions.




Like this post? subscribe to the feed.





