chore: ARTEX 初始化
ARTEX — AI 自主渗透测试系统(Go 后端 + Next.js 前端,单二进制内嵌)。 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
commit
0ef8561411
287 files changed
+70178
No files matched your search
@@ -0,0 +1,24 @@
|
||||
// Client-side cookie utilities.
|
||||
// These functions manage cookies in the browser only.
|
||||
// Server actions handle cookie updates on the server side.
|
||||
|
||||
function writeClientCookie(serializedCookie: string) {
|
||||
// biome-ignore lint/suspicious/noDocumentCookie: This project still uses document.cookie for broad browser support.
|
||||
document.cookie = serializedCookie;
|
||||
}
|
||||
|
||||
export function setClientCookie(key: string, value: string, days = 7) {
|
||||
const expires = new Date(Date.now() + days * 864e5).toUTCString();
|
||||
writeClientCookie(`${key}=${value}; expires=${expires}; path=/`);
|
||||
}
|
||||
|
||||
export function getClientCookie(key: string) {
|
||||
return document.cookie
|
||||
.split("; ")
|
||||
.find((row) => row.startsWith(`${key}=`))
|
||||
?.split("=")[1];
|
||||
}
|
||||
|
||||
export function deleteClientCookie(key: string) {
|
||||
writeClientCookie(`${key}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`);
|
||||
}
|
||||
Reference in new issue
Block a user