2017-01-10 5 views
0

クッキーを使用して他のドメインにリダイレクトすることはできますか?私はfollowongを試みた。クッキーでリダイレクト

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 

しかし、動作しませんでした。私のクッキーは表示されません。

enter image description here

答えて

2

あなたは別のドメインのクッキーを設定することはできません。これを許すことは、巨大なセキュリティ上の欠陥をもたらすでしょう。

関連する問題