0
좋아요, 그래서 저는 Ruby를 사용하여 쿠키를 설정하려고합니다. 나는 랙 환경에있다. response[name]=value
은 해시 랙에있는 HTTP 헤더에 HTTP 헤더를 추가합니다. 나는 그것이 효과가 있다는 것을 안다. 쿠키 설정
def set_cookie(opts={}) args = { :name => nil, :value => nil, :expires => Time.now+314, :path => '/', :domain => Cambium.uri #contains the IP address of the dev server this is running on }.merge(opts) raise ArgumentError, ":name and :value are mandatory" if args[:name].nil? or args[:value].nil? response['Set-Cookie']="#{args[:name]}=#{args[:value]}; expires=#{args[:expires].clone.gmtime.strftime("%a, %d-%b-%Y %H:%M:%S GMT")}; path=#{args[:path]}; domain=#{args[:domain]}" end
왜? 어떻게 해결할 수 있습니까? 감사.
기계의 IP 주소 또는 도메인 이름으로 사이트에 액세스하십니까? – zneak
지금 IP 주소로. –