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

Add cookie

parent 907c6eee
No related branches found
No related tags found
No related merge requests found
import './styles/App.css'; import './styles/App.css';
import React, { useState } from "react"; import React, { useState } from "react";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import Connected from './pages/Connected'; import Connected from './pages/Connected';
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import { ToastContainer } from "react-toastify" import { ToastContainer } from "react-toastify"
import 'react-toastify/dist/ReactToastify.css'; import 'react-toastify/dist/ReactToastify.css';
import { useNavigate, useLocation } from "react-router-dom"; import { useNavigate, useLocation } from "react-router-dom";
import { Cookies, useCookies } from 'react-cookie'
...@@ -17,7 +17,11 @@ function App(props) { ...@@ -17,7 +17,11 @@ function App(props) {
const { code } = useParams(); const { code } = useParams();
const { search } = useLocation(); const { search } = useLocation();
let url = new URLSearchParams(search) 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 onSubmit = (e) => {
const tagger = { const tagger = {
...@@ -56,8 +60,6 @@ function App(props) { ...@@ -56,8 +60,6 @@ function App(props) {
) )
} }
} }
export default App; export default App;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment