chromesetting
jingquan huang 5 years ago
parent 8ad1a97dbf
commit a54d53eaf4

@ -292,14 +292,9 @@ class ApplicationController < ActionController::Base
# and starts a session if needed # and starts a session if needed
def find_current_user def find_current_user
uid_logger("user setup start: session[:user_id] is #{session[:user_id]}") uid_logger("user setup start: session[:user_id] is #{session[:user_id]}")
if current_laboratory.main_site? if session[:user_id]
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"]
# existing session # 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 elsif autologin_user = try_to_autologin
autologin_user autologin_user
elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth? elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth?

@ -62,17 +62,7 @@ module LoginHelper
end end
def start_user_session(user) def start_user_session(user)
session[:"#{request.subdomain}_user_id"] = user.id session[: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[:ctime] = Time.now.utc.to_i session[:ctime] = Time.now.utc.to_i
session[:atime] = Time.now.utc.to_i session[:atime] = Time.now.utc.to_i
end end

Loading…
Cancel
Save