2017-01-10 46 views
0

使用cookie可以重定向到其他域名吗?我尝试followong。使用cookies重定向

def test_redirect 
    response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate' 
    response.headers['Pragma'] = 'no-cache' 
    response.headers['Expires'] = '0' 

    request.cookies[:foo] = {value: 'Viktor is here!', domain: '.google.com'} 

    redirect_to 'http://google.com/' 
end 

但没有奏效。我的cookie不出现。

enter image description here

回答

2

您无法为其他域设置Cookie。允许这会带来巨大的安全缺陷。