lib/global_session/directory.rb in global_session-2.0.0 vs lib/global_session/directory.rb in global_session-2.0.1

- old
+ new

@@ -103,10 +103,19 @@ # InvalidSession:: if the session contained in the cookie has been invalidated # ExpiredSession:: if the session contained in the cookie has expired # MalformedCookie:: if the cookie was corrupt or malformed # SecurityError:: if signature is invalid or cookie is not signed by a trusted authority def create_session(*params) - Session.new(self, *params) + forced_version = configuration['cookie']['version'] + + case forced_version + when 2 + Session::V2.new(self, *params) + when 1 + Session::V1.new(self, *params) + else + Session.new(self, *params) + end end def local_authority_name @configuration['authority'] end \ No newline at end of file