import { Context } from "./context"; /** * Object that handle the session * * To get stateless server the session is encrypted inside a cookie, so you should not store large amount of data in it * If you need big session then i would suggest to use a Memcache store with the user.uuid as a key * * It is part of the core framework implementation, you should not rely on any method of this object, as the implementation can change if needed * An object session is exposed by the framework, so use this one ( for now it is a SecureCookie.getProxy() but can evolve ) * * The object use Object.observe if available or try Proxy in other case, so old JS VM won't run it */ declare class SecureCookie { _name: string; _algo: string; _secret: string; _changed: boolean; _raw: string; [key: string]: any; /** @ignore */ constructor(name: string, options: any, ctx: Context, datas?: any); getRaw(name: any, cookies: any): string; getProxy(): this; destroy(): void; toJSON(): any; save(ctx: Context): void; sendCookie(ctx: any, name: any, value: any, params: any): void; needSave(): boolean; } declare class SessionCookie extends SecureCookie { constructor(ctx: Context); userId: string; identUsed: string; getIdentUsed(): string; getUserId(): string; logout(): void; login(userId: any, identUsed: any): void; isLogged(): boolean; needSave(): boolean; init(): Promise; } export { SecureCookie, SessionCookie };