I have the following NodeJS code:
let sql = `SELECT box_id, cubby_id, occupied, comport
FROM box
WHERE longestDimension = ?
AND LOWER(box_id) = LOWER(?)`;
connection.query(sql, [boxSelectedDimension, boxSelectedValue] , function(err, rows, fields) {
if (!err) {
for(var i=0; i< rows.length; i++) {
// Make the comparaison case insensitive
if (rows[i].occupied == `unoccupied`) {
console.log("free");
var comport = rows[i].comport;
var command = "open" + rows[i].cubby_id;
Essentially i would like to store the value of the comport and command variable in a session variable so that the value of these variable could be used in another router page in nodejs.
I am not sure how to store and retrieve the session variable.