Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

broken-yar

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broken-yar

![yar Logo](https://raw.github.com/walmartlabs/yar/master/images/yar.png)

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

yar Logo

A hapi cookie jar

Build Status

The yar plugin adds a simple way to set a persistant state (using an Iron encrypted cookie) across requests. It has support for session management - either stored on the client via cookie, in server memory, or using an external database (via custom storage code).

For example, the first handler sets the jar content and the second utilizes it:

var handler1 = function () {

    this.plugins.yar = {
        key: 'value'
    };

    return this.reply();
};

var handler2 = function () {

    this.reply(this.state.yar.key);     // Will send back 'value'
};

The plugin requires a password for encryption, and the ext permission:

var options = {
    permissions: {
        ext: true                   // Required
    },
    plugin: {
        name: 'yar' ,               // Optional, overrides cookie name. Defaults to 'yar'. Doesn't affect 'plugins.yar'.
        isSingleUse: false,         // Optional, clears jar after one request. Defaults to false.
        options: {
            password: 'password',   // Required
            isSecure: true          // Optional, any supported cookie options except `encoding`
        }
    }
};

var server = new Hapi.Server();

server.plugin().require('yar', options, function (err) { });

Sessions

FAQs

Package last updated on 22 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc