From f8e16879dde0fb14b9bdbb0bd0f098fa8208bb0f Mon Sep 17 00:00:00 2001 From: Sebastian Frank Date: Tue, 17 Aug 2021 13:26:39 +0200 Subject: [PATCH] cookie hook functions --- index.d.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/index.d.ts b/index.d.ts index 4dd583c..24868e9 100644 --- a/index.d.ts +++ b/index.d.ts @@ -383,6 +383,28 @@ export interface HookContext extends GetHookData, GetHookGetOnlyData, PostHookDa * @param options options */ xmlParse(xml:string, options?: {}): any + + /** + * get cookie from http header + * + * @param name cookie name + */ + cookieGet(name: string): string + + /** + * set cookie via http header + * + * @param name cookie name + * @param value cookie value + * @param options cookie options + */ + cookieSet(name: string, value: string, options?:{ + maxAge?: number + path?:string + domain?:string + secure?:boolean + httpOnly?:boolean + }): void } export interface HookException {