Rubycas:使用CASClient::Frameworks::Rails::Filter login\u to\u service()方法时清空cookies

Rubycas:使用CASClient::Frameworks::Rails::Filter login\u to\u service()方法时清空cookies,ruby,cookies,rubycas,Ruby,Cookies,Rubycas,我发现RubyCAS是一个非常有用的工具,但是从我网站上的表单登录时会出现问题。 表单为默认值&隐藏字段a,如下所示: <td id="submit-container"> <input type="hidden" id="lt" name="lt" value="<%= @lt %>" /> <input type="hidden" id="service" name="service" value="<%= @service

我发现RubyCAS是一个非常有用的工具,但是从我网站上的表单登录时会出现问题。 表单为默认值&隐藏字段a,如下所示:

  <td id="submit-container">
    <input type="hidden" id="lt" name="lt" value="<%= @lt %>" />
    <input type="hidden" id="service" name="service" value="<%= @service %>" />
    <input type="submit" class="button" accesskey="l" value="Поехали"
           tabindex="4" id="login-submit" />
  </td>
尝试使用rubycas服务器打开另一个应用程序时,我有空cookie

当使用rubycas服务器以开箱即用的形式登录到第一个应用程序时,一切正常,我自动登录到第二个应用程序

请帮忙!在这个问题上花了3天

class UsersController < ApplicationController
 before_filter CASClient::Frameworks::Rails::Filter, :except => [:new, :create, :cas_login]

 def cas_login
    credentials = { :username => params[:username], :password => params[:password]}
    client = CASClient::Frameworks::Rails::Filter
    @resp = client.login_to_service(self, credentials, 'http://local.mysite:3000/users/login')

    if @resp.service_redirect_url.nil?
      # if login failed, redisplay the page that has your login-form on it                                                                                                                                          
      flash[:error] = "Invalid email or password"

      redirect_to root_url
    else                                                                                                                                                                                 
      return redirect_to(@resp.service_redirect_url)
    end
  end
end
response.set_cookie('tgt', tgt.to_s)