@types/cookie-session

  • Version 2.0.48
  • Published
  • 6.9 kB
  • 2 dependencies
  • MIT license

Install

npm i @types/cookie-session
yarn add @types/cookie-session
pnpm add @types/cookie-session

Overview

TypeScript definitions for cookie-session

Index

Namespaces

module 'cookie-session' {}
    cookieSession: (
    options?: CookieSessionInterfaces.CookieSessionOptions
    ) => express.RequestHandler;

      namespace CookieSessionInterfaces

      namespace CookieSessionInterfaces {}

        interface CookieSessionObject

        interface CookieSessionObject {}

          property isChanged

          isChanged?: boolean | undefined;
          • Is true if the session has been changed during the request.

          property isNew

          isNew?: boolean | undefined;
          • Is true if the session is new.

          property isPopulated

          isPopulated?: boolean | undefined;
          • Determine if the session has been populated with data or is empty.

          index signature

          [propertyName: string]: any;

            interface CookieSessionOptions

            interface CookieSessionOptions {}

              property domain

              domain?: string | undefined;
              • a string indicating the domain of the cookie (no default).

              property expires

              expires?: Date | undefined;
              • a Date object indicating the cookie's expiration date (expires at the end of session by default).

              property httpOnly

              httpOnly?: boolean | undefined;
              • a boolean indicating whether the cookie is only to be sent over HTTP(S), and not made available to client JavaScript (true by default).

              property keys

              keys?: string[] | import('keygrip') | undefined;
              • The list of keys to use to sign & verify cookie values. Set cookies are always signed with keys[0], while the other keys are valid for verification, allowing for key rotation.

              property maxAge

              maxAge?: number | undefined;
              • a number representing the milliseconds from Date.now() for expiry.

              property name

              name?: string | undefined;
              • The name of the cookie to set, defaults to session.

              property overwrite

              overwrite?: boolean | undefined;
              • a boolean indicating whether to overwrite previously set cookies of the same name (true by default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie.

              property path

              path?: string | undefined;
              • a string indicating the path of the cookie (/ by default).

              property sameSite

              sameSite?: 'strict' | 'lax' | 'none' | boolean | undefined;
              • a boolean or string indicating whether the cookie is a "same site" cookie (false by default). This can be set to 'strict', 'lax', 'none', or true (which maps to 'strict').

              property secret

              secret?: string | undefined;
              • A string which will be used as single key if keys is not provided.

              property secure

              secure?: boolean | undefined;
              • a boolean indicating whether the cookie is only to be sent over HTTPS (false by default for HTTP, true by default for HTTPS).

              property secureProxy

              secureProxy?: boolean | undefined;
              • a boolean indicating whether the cookie is only to be sent over HTTPS (use this if you handle SSL not in your node process).

              property signed

              signed?: boolean | undefined;
              • a boolean indicating whether the cookie is to be signed (true by default). If this is true, another cookie of the same name with the .sig suffix appended will also be sent, with a 27-byte url-safe base64 SHA1 value representing the hash of cookie-name=cookie-value against the first Keygrip key. This signature key is used to detect tampering the next time a cookie is received.

              interface CookieSessionRequest

              interface CookieSessionRequest {}

                property session

                session?: CookieSessionObject | null | undefined;
                • Represents the session for the given request.

                property sessionOptions

                sessionOptions: CookieSessionOptions;
                • Represents the session options for the current request. These options are a shallow clone of what was provided at middleware construction and can be altered to change cookie setting behavior on a per-request basis.

                namespace Express

                namespace Express {}

                  interface Request

                  interface Request extends CookieSessionInterfaces.CookieSessionRequest {}

                    Package Files (1)

                    Dependencies (2)

                    Dev Dependencies (0)

                    No dev dependencies.

                    Peer Dependencies (0)

                    No peer dependencies.

                    Badge

                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/cookie-session.

                    • Markdown
                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/cookie-session)
                    • HTML
                      <a href="https://www.jsdocs.io/package/@types/cookie-session"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>