Skip to content
Snippets Groups Projects
Commit 782d412d authored by Raphaël Faure's avatar Raphaël Faure
Browse files

Add cookie

parent 907c6eee
Branches
No related tags found
No related merge requests found
import './styles/App.css';
import React, { useState } from "react";
import { useParams } from "react-router-dom";
import Connected from './pages/Connected';
import { toast } from "react-toastify";
import { ToastContainer } from "react-toastify"
import 'react-toastify/dist/ReactToastify.css';
import { useNavigate, useLocation } from "react-router-dom";
import { Cookies, useCookies } from 'react-cookie'
......@@ -17,7 +17,11 @@ function App(props) {
const { code } = useParams();
const { search } = useLocation();
let url = new URLSearchParams(search)
const [cookies, setCookie] = useCookies(['once'])
let d = new Date()
d.setTime(d.getTime() + 60);
setCookie('is', '1', { path: "/", d });
console.log(cookies);
const onSubmit = (e) => {
const tagger = {
......@@ -56,8 +60,6 @@ function App(props) {
)
}
}
export default App;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment