def mongo_fix_session_keys(session = {})
      new_session = Hash.new
      session.to_hash.each do |i, j|
        new_session[i.gsub(/\./i, "|")] = j.inspect
      end unless session.empty?
      new_session
    end
def mongo_fix_session_keys(session = {})
      new_session = Hash.new
      session.to_hash.each do |i, j|
        new_session[i.gsub(/\./i, "|")] = j.inspect
      end unless session.empty?
      new_session
    end
session keys can be with dots. It is invalid keys for BSON