lib/merb/session/merb_memory_session.rb in merb-0.1.0 vs lib/merb/session/merb_memory_session.rb in merb-0.2.0
- old
+ new
@@ -2,18 +2,18 @@
module SessionMixin
def setup_session
MERB_LOGGER.info("Setting up session")
- before = cookies[session_id_key]
- @session , cookies[session_id_key] = Merb::MemorySession.persist(cookies[session_id_key])
- @_new_cookie = cookies[session_id_key] != before
+ before = @cookies[ancestral_trait[:session_id_key]]
+ @session , @cookies[ancestral_trait[:session_id_key]] = Merb::MemorySession.persist(@cookies[ancestral_trait[:session_id_key]])
+ @_new_cookie = @cookies[ancestral_trait[:session_id_key]] != before
end
def finalize_session
MERB_LOGGER.info("Finalize session")
- set_cookie(session_id_key, cookies[session_id_key], Time.now+Merb::Const::WEEK*2) if @_new_cookie
+ set_cookie(ancestral_trait[:session_id_key], @cookies[ancestral_trait[:session_id_key]], Time.now+Merb::Const::WEEK*2) if @_new_cookie
end
end
class MemorySession
@@ -71,10 +71,11 @@
end
def delete(key)
@mutex.synchronize {
@sessions.delete(key)
+ @timestamps.delete(key)
}
end
def reap_old_sessions
@timestamps.each do |key,stamp|
@@ -100,6 +101,6 @@
end # end singleton class
end # end DRbSession
-end
+end
\ No newline at end of file