How to use the session function from request

Find comprehensive JavaScript request.session code examples handpicked from public code repositorys.

221
222
223
224
225
226
227
228
229
230
231
232


app.get('/feedback', async function(request, response) {
  
  const Compra = require("./models/compra");
  const Cart = require("./models/Cart");
  const IdUsuario = request.session.passport.user.id;


    await Compra.updateOne({Id_transaccion:request.query.preference_id}, {$set:{Id_pago:request.query.payment_id,Orden_mercancia:request.query.merchant_order_id,Nombre_comprador:request.user.username,status:request.query.status}})
    await Cart.deleteMany({UsuarioId:IdUsuario});
    response.redirect('/');
fork icon0
star icon0
watch icon1