{"id":16303,"library":"biskviit","title":"Biskviit HTTP Cookie Handler","description":"Biskviit is a Node.js module designed for server-side HTTP cookie management. It provides functionality to parse `Set-Cookie` headers from incoming responses, store cookie data in memory, and then generate appropriate `Cookie` headers for outgoing requests based on a specified URL. The current stable version is 2.0.0, which was last updated in August 2017. Due to its age, the package is considered to have an abandoned release cadence. Its key differentiator is its straightforward, in-memory approach to handling cookie state per instance, including basic session timeout management for cookies without explicit expiration dates. It is specifically built for Node.js environments and requires Node.js v6 or higher.","status":"abandoned","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/andris9/biskviit","tags":["javascript","HTTP","cookie","cookies"],"install":[{"cmd":"npm install biskviit","lang":"bash","label":"npm"},{"cmd":"yarn add biskviit","lang":"bash","label":"yarn"},{"cmd":"pnpm add biskviit","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CommonJS-only and does not provide native ESM exports. The default export is the Biskviit class itself. Node.js v6+ is required.","wrong":"import Biskviit from 'biskviit';\nimport { Biskviit } from 'biskviit';","symbol":"Biskviit","correct":"const Biskviit = require('biskviit');"}],"quickstart":{"code":"const Biskviit = require('biskviit');\n\n// Create a cookie managing instance with a 5-minute session timeout\nconst biskviit = new Biskviit({\n    sessionTimeout: 5 * 60 // expire cookies after 5 minutes\n});\n\n// Simulate setting cookies from a 'Set-Cookie' header\nbiskviit.set('theme=light', 'http://example.com/');\nbiskviit.set('sessionToken=abc123; Expires=Wed, 09 Jun 2029 10:18:14 GMT; Path=/', 'http://example.com/');\nbiskviit.set('another=cookie; Max-Age=3600', 'https://secure.example.com/app');\n\n// Get cookies for a specific URL as a string for the 'Cookie' header\nconst cookiesForExample = biskviit.get('http://example.com/path');\nconsole.log('Cookies for example.com:', cookiesForExample); // Expected: theme=light; sessionToken=abc123\n\nconst cookiesForSecureExample = biskviit.get('https://secure.example.com/app/dashboard');\nconsole.log('Cookies for secure.example.com:', cookiesForSecureExample); // Expected: another=cookie\n\n// List all available cookies for a URL as objects\nconst cookieObjects = biskviit.list('http://example.com/');\nconsole.log('Cookie objects for example.com:', cookieObjects);","lang":"javascript","description":"Demonstrates initializing a Biskviit instance, setting cookies from `Set-Cookie` headers, and retrieving them for specific URLs both as a header string and as an array of objects."},"warnings":[{"fix":"Consider migrating to a more actively maintained HTTP cookie library for Node.js, especially for new projects or applications requiring robust security and modern features.","message":"The package has not been updated since August 2017, indicating it is largely unmaintained. This poses risks for security vulnerabilities, compatibility issues with newer Node.js versions, and lack of modern features (e.g., native ESM support).","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use CommonJS `require()` syntax: `const Biskviit = require('biskviit');`. If you must use it in an ESM project, you might need to use dynamic `import()` or a CommonJS wrapper, though migration is recommended.","message":"Biskviit is a CommonJS-only module and does not provide native ECMAScript Modules (ESM) exports. Attempting to `import` Biskviit in an ESM context will result in a runtime error.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"If persistence is required, you must implement your own storage mechanism (e.g., to a file, database, or external cache) and manually load/save cookie data using Biskviit's `list` and `set` methods.","message":"The cookie storage is entirely in-memory for each `Biskviit` instance. Cookies are not persisted across application restarts or between different instances of the `Biskviit` class.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Ensure your Node.js environment is version 6.0.0 or higher. It is generally advisable to use a significantly newer, actively supported Node.js LTS version.","message":"The package explicitly requires Node.js v6 or newer. Running it on older Node.js versions may lead to unexpected behavior or errors.","severity":"gotcha","affected_versions":"<2.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Biskviit is a CommonJS module. Either convert your file to CommonJS (`.js` without `\"type\": \"module\"` in `package.json`) or use dynamic `import()`: `const Biskviit = await import('biskviit').then(mod => mod.default);`.","cause":"Attempting to use `require()` in an ECMAScript Module (ESM) context.","error":"ReferenceError: require is not defined"},{"fix":"Ensure you are using `const Biskviit = require('biskviit');` and then `const biskviit = new Biskviit(options);`.","cause":"Incorrectly importing `Biskviit` or attempting to call it as a function instead of instantiating with `new`.","error":"TypeError: Biskviit is not a constructor"},{"fix":"Verify that the URL used with `get()` exactly matches the context for which the cookies were `set()`, considering domain, path, and secure flags. Ensure `cookieString` passed to `set()` is a valid `Set-Cookie` header value.","cause":"Mismatch between the URL provided to `set` and `get` (e.g., protocol, domain, or path differences) or incorrect `Set-Cookie` string format.","error":"Cookies are not being stored or retrieved correctly for a URL."}],"ecosystem":"npm"}