Problem with sessions, subdomains and authlogic in Rails

I have a rails application with authlogic authentication and a username.domain.com structure created using subdomain-fu.

But my session is interrupted when switching from .com domain to username.domain.com. I tried to add

config.action_controller.session = {:domain => '.localhost:3000'}

to my development.rb, but these seams are to disable the autologous disable input / input.

Any suggestions on what to do?

Thanks in advance!

+3
source share
3 answers

, , , prod. cookie . .

config.action_controller.session = {:domain => '.localhost:3000'}

,

config.action_controller.session = {:domain => '.com'}

, localhost.localdomain dummylocal.com, - , .

config.action_controller.session = {:domain => 'localhost.localdomain'}
config.action_controller.session = {:domain => 'dummylocal.com'}
+1

Rails3 NoMethodError:

undefined method `session=' for ActionController::Base:Class

, Rails3 , app/config/initializers/session_store.rb :

YourAppName::Application.config.session_store :active_record_store,
    {:key => '_your_namespace_session', :domain => '.yourdomain.com'}
+1

Source: https://habr.com/ru/post/1736791/


All Articles