def new_session
      on_campus = on_campus?(request.remote_ip)
      is_mobile = is_mobile?
      session_expiry = 5.minutes.from_now
      session_uuid = SecureRandom.uuid

      # create session in db
      @session = Session.create(session_uuid: session_uuid, expiry: session_expiry, on_campus: on_campus, is_mobile: is_mobile)
      # set cookie
      cookies[:session_id] = { :value => session_uuid, :expires => session_expiry }
    end
def new_session
      on_campus = on_campus?(request.remote_ip)
      is_mobile = is_mobile?
      session_expiry = 5.minutes.from_now
      session_uuid = SecureRandom.uuid

      # create session in db
      @session = Session.create(session_uuid: session_uuid, expiry: session_expiry, on_campus: on_campus, is_mobile: is_mobile)
      # set cookie
      cookies[:session_id] = { :value => session_uuid, :expires => session_expiry }
    end
Creates a new session, and logs it in the database

 A session is tracked by a UUID that is stored in a cookie, and has a 5 minute expiry time.
 Sessions are stored in the database with the time they were initiated, their expiry time (or end time),
 whether the request originated from a campus IP address, and whether the request originated from a mobile device