|
|
|
@ -62,21 +62,18 @@ module LoginHelper
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def start_user_session(user)
|
|
|
|
|
re_subdomain = "#{request.subdomain.split('.').first}_user_id"
|
|
|
|
|
# re_subdomain = "#{request.subdomain.split('.').first}_user_id"
|
|
|
|
|
# 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[:"#{re_subdomain}"] = nil
|
|
|
|
|
session[:user_id] = nil
|
|
|
|
|
# session[:"#{re_subdomain}"] = user.id
|
|
|
|
|
Rails.logger.info("domain_user_id session is: 3333332222111#{session[:"#{re_subdomain}"]}")
|
|
|
|
|
Rails.logger.info("user_id session is: 3333332222111#{session[: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
|
|
|
|
|