diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7d6556b9a..1bc2bad7d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -292,14 +292,9 @@ class ApplicationController < ActionController::Base # and starts a session if needed def find_current_user uid_logger("user setup start: session[:user_id] is #{session[:user_id]}") - if current_laboratory.main_site? - - end - - Rails.logger.info("find current_user: subdomain is #{request.subdomain} and user session is #{session[:user_id]} -- #{session[:"#{request.subdomain}_user_id"]}") - if session[:"#{request.subdomain}_user_id"] + if session[:user_id] # existing session - (User.active.find(session[:"#{request.subdomain}_user_id"]) rescue nil) + (User.active.find(session[:user_id]) rescue nil) elsif autologin_user = try_to_autologin autologin_user elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth? diff --git a/app/controllers/concerns/login_helper.rb b/app/controllers/concerns/login_helper.rb index a95723690..e94cf8a21 100644 --- a/app/controllers/concerns/login_helper.rb +++ b/app/controllers/concerns/login_helper.rb @@ -62,17 +62,7 @@ module LoginHelper end def start_user_session(user) - session[:"#{request.subdomain}_user_id"] = user.id - Rails.logger.info("domain_user_id session is: 3333332222111#{session[:"#{request.subdomain}_user_id"]}") - Rails.logger.info("user_id session is: 3333332222111#{session[:"#{request.subdomain}_user_id"]}") - - # if current_laboratory.main_site? - # session[:user_id] = user.id - # else - # session[:"#{request.subdomain}_user_id"] = user.id - # end - - # session[:user_id] = user.id + session[:user_id] = user.id session[:ctime] = Time.now.utc.to_i session[:atime] = Time.now.utc.to_i end