Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- useEffect(() => {
- socket.emit('login', myLoginCode)
- }, [])
- app.get('login', (req, res) => {
- const cookieProtected = {
- maxAge: 946080000000,
- httpOnly: true,
- secure: true,
- sameSite: true
- }
- res.cookie('id', login, cookieProtected)
- res.cookie('session', encryptSession, cookieProtected)
- res.cookie('logged', 'true', {
- maxAge: 946080000000,
- secure: true,
- sameSite: true
- })
- })
- socket.on('login', loginCode => {
- // How to to place cookies in user browser from here?
- }
Add Comment
Please, Sign In to add comment