def sign_in(resource_or_scope, *args)
      options  = args.extract_options!
      scope    = Devise::Mapping.find_scope!(resource_or_scope)
      resource = args.last || resource_or_scope
      expire_session_data_after_sign_in!
      warden.set_user(resource, options.merge!(:scope => scope))

      # set user id
      post_signin resource, options
    end
def sign_in(resource_or_scope, *args)
      options  = args.extract_options!
      scope    = Devise::Mapping.find_scope!(resource_or_scope)
      resource = args.last || resource_or_scope
      expire_session_data_after_sign_in!
      warden.set_user(resource, options.merge!(:scope => scope))

      # set user id
      post_signin resource, options
    end
Sign in an user that already was authenticated. This helper is useful for logging
 users in after sign up.

 Examples:

   sign_in :user, @user                      # sign_in(scope, resource)
   sign_in @user                             # sign_in(resource)
   sign_in @user, :event => :authentication  # sign_in(resource, options)