def update_session
      # update session expiry in the database
      session_id = cookies[:session_id]
      @session = Session.find_by session_uuid: session_id
      @session.expiry = 5.minutes.from_now
      @session.save

      # update session expiry on cookie
      cookies[:session_id] = { :value => session_id, :expires => @session.expiry }
    end
def update_session
      # update session expiry in the database
      session_id = cookies[:session_id]
      @session = Session.find_by session_uuid: session_id
      @session.expiry = 5.minutes.from_now
      @session.save

      # update session expiry on cookie
      cookies[:session_id] = { :value => session_id, :expires => @session.expiry }
    end
Updates a session's expiration time on cookie and in database

 When a request is made with a non-expired session, the expiration time is updated to 5 minutes from the current time.
 This update is reflected in the cookie as well as in the database entry for the session.