In my web application, I store some data on the local storage of browsers. This data forms a part of the following SQL. Users may request the SQL many times in a session.
SELECT * from table WHERE id NOT IN (...local storage data) ORDER BY RAND() LIMIT 1
To avoid posting data from local storage each time the request is made, can I create a temporary table to store the data instead, that can last until the user leaves my site?