ãµããã¡ã¤ã³ã§Cookieãå ±æããRails3ã®è¨å®
Yahoo!ãã¯ã¦ãªã¯åãµã¼ãã¹ãã¨ã«ãµããã¡ã¤ã³ã§ã¢ã¯ã»ã¹ãã¾ãããã©ããã£ã¦ã»ãã·ã§ã³ç¶æãã¦ãã®ããªã¨æãããµããã¡ã¤ã³ã«Cookieã渡ãæ¹æ³ã調ã¹ãã¨ãã
Cookieã®Domainå±æ§ã«Domain=.mydomain.comã®æ§ã«æå®ããã°è¯ããã§ããã
Rails 3ã§ã®è¨å®ã調ã¹ã¦ã¿ã¾ããã
Cookieã®è¨å®ã®ããã©ã«ãå¤ã¯config/initializers/session_store.rbã§è¨å®ã§ãã¾ãã
ãdomain:ãã«ã.mydomain.comãã®æ§ã«è¨å®ããã¨ãa.mydomain.comã®ã¯ããã¼ãb.mydomain.comã«ã渡ãã¾ãã
Rails.application.config.session_store :cookie_store, :key => '_app_session', :domain => '.mydomain.com'
ã³ã³ããã¼ã©ã¼ãªã©ã§æå®ããå ´åã¯ãããªæãã
cookies[:cookie_name] = {:value => "sub domain cookie", :domain => '.mydomain.com' }