"use client";
import { useEffect } from "react";
/**
* Captures ?plt= from the URL into sessionStorage + cookie (client only).
* Usage: add under the body in layout
*/
export function PltBootstrap() {
useEffect(() => {
const plt = new URLSearchParams(window.location.search).get("plt");
if (!plt) return;
try {
sessionStorage.setItem("planetir_plt", plt);
} catch {
/* ignore private mode / blocked storage */
}
document.cookie = `plt=${encodeURIComponent(plt)}; path=/; max-age=2592000; SameSite=Lax`;
}, []);
return null;
}
ᐧ