Modify CookieStore middleware inheritance to avoid subclassing Rack::Session::Cookie [Fix for #7372]

As discussed in #7372, this PR contains commits that change `ActionDispatch::Session::CookieStore` to inherit from `Rack::Session::Abstract::ID` instead of `Rack::Session::Cookie`.