import { useSession } from "vinxi/http";
function getSession() {
return useSession({
password: process.env.SESSION_SECRET
});
}
export default function Index() {
const session = getSession();
session.data.user = "adam"; //set the user name
const username : string = session.data.user //get the user name
return (
<div>
<p>Username: {username}</p>
</div>
);
}
import { useSession } from "vinxi/http";
function getSession() {
return useSession({
password: process.env.SESSION_SECRET
});
}
export default function Index() {
const session = getSession();
session.data.user = "adam"; //set the user name
const username : string = session.data.user //get the user name
return (
<div>
<p>Username: {username}</p>
</div>
);
}