In addition to Mattheus. The statement
signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
is perhaps the best general log out statement, considering the possibility of being signed in with multiple roles. If, for you case, your user is just signed in as one role, and you want to preserve the rest of the session on signout, the easiest way is to do:
$ git clone git://github.com/plataformatec/devise.git
$ cd devise
$ git branch my_devise
$ git checkout my_devise
Open app/controllers/devise/sessions_controller.rb in your editor. In the method destroy, replace
signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
with
signed_out = sign_out(resource_name)
Save and exit editor and do
$ git commit -am "remove only warden data from session on logout, preserve other data."
In the Gemfile of your project, describe the dependency to devise like
gem 'devise', :path => "[YOUR PATH]/devise", :branch => "my_devise"