fix getting key from session, which does not implement dict API