Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

root/trunk/actionpack/lib/action_controller/session/drb_store.rb

Revision 5512, 0.6 kB (checked in by bitsweat, 3 years ago)

Always clear model associations from session. Closes #4795.

Line 
1 require 'cgi'
2 require 'cgi/session'
3 require 'drb'
4  
5 class CGI #:nodoc:all
6   class Session
7     class DRbStore
8       @@session_data = DRbObject.new(nil, 'druby://localhost:9192')
9  
10       def initialize(session, option=nil)
11         @session_id = session.session_id
12       end
13  
14       def restore
15         @h = @@session_data[@session_id] || {}
16       end
17  
18       def update
19         @@session_data[@session_id] = @h
20       end
21  
22       def close
23         update
24       end
25  
26       def delete
27         @@session_data.delete(@session_id)
28       end
29      
30       def data
31         @@session_data[@session_id]
32       end
33     end
34   end
35 end
Note: See TracBrowser for help on using the browser.