session - Subdomain cookie sharing in Rails 3 is not working (on Heroku)? -


i'm trying have cookies on site dapshare.com work both root address , 'www' subdomain.

a lot of other stackoverflow answers (and great railscasts vid on topic) have suggested adding line session_store.rb:

dapshare::application.config.session_store :cookie_store, :key => '_dapshare_session', :domain => :all 

this doesn't seem make difference: if log in @ dapshare.com, still not logged in @ www.dapshare.com.

am doing wrong here? using following code store information in cookie:

cookies.permanent.signed[:thing_to_store] = store_information 

thanks help!

short answer: using 'cookies[:new_cookie] =' not seem grab domain session_store config settings.

i added :domain new cookie , works:

cookies.permanent.signed[:new_cookie] = {:value => new_value, :domain => ".dapshare.com"} 

for else reading, need specify domain when deleting cookie

cookies.delete :new_cookie, :domain => ".dapshare.com" 

(thanks diagnosis andrew marshall.)


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -