Skip to content

Commit

Permalink
add method for cookie "echoing"
Browse files Browse the repository at this point in the history
  • Loading branch information
mpabst-udg committed Feb 21, 2024
1 parent 5dbc37c commit 9ccce3e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ app.get("/inc", (req, res, next) => {
}
res.cookie("inc", ++inc, { maxAge: 10800 }).send("cookie set to" + inc);
});

app.get("/cookie-echo", () => {
var value = req.cookies["cookie-in"];
res
.cookie("cookie-out", value, { maxAge: 10 })
.send("out cookie set to" + value);
});

0 comments on commit 9ccce3e

Please sign in to comment.