Unusual autologic issue only in production

Context : rails application with authlogic for sigup and login Configuration Information: Rails 2.3.2

A controller called messages with the action 'show'. When logging in, I display a message / index page.

and when the user clicks on an item, the details are displayed. Pretty standard stuff.

All this works fine and dandy both in development and in production (Apache with Passenger 2.2.5 on ubuntu and mysql) EXCEPT for the following problem in one case:

Problem : ONLY on Firefox / Safari / Chrome (IE7 is OK) and ONLY in PRODUCTION,

When the user logs in for the FIRST time in a new session (open a new browser, enter the URL), the index page is displayed in order and when the item is clicked, the user becomes mysterious. LOGGED OUT (current_user returns null).

When you log in again, everything returns to normal β€” you can log out and log in as many times as you like, and no problem β€” DO NOT close your browser and start again.

Any action other than 'show' saves current_user and works just fine.

Question : How is a user session lost in a call like this message / id only once - for the first time? The show action does nothing special.

I used both ActiveRecord storage and cookies to manage the session with the same behavior.

- - , !

+3
1

, : http://yoursite.com http://www.yoursite.com

, : http://garrickvanburen.com/archive/rails-cookie-settings-for-cross-subdomain-sessions

: : config.action_controller.session[:domain] = '.YOURDOMAIN.COM' environment.rb(, .). cookie www.yourdomain.com, yourdomain.com( ).

: 2.3.2.

+3

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


All Articles