@consumidor-positivo/ts-utils - v1.16.0
    Preparing search index...

    Function getHasCookie

    • Checks if a cookie exists.

      Parameters

      • key: string

        The name of the cookie to check

      Returns boolean

      True if the cookie exists, false otherwise

      if (getHasCookie('token')) {
      console.log('User is authenticated');
      }

      // Or use with getCookie
      const hasSession = getHasCookie('sessionId');