Skip to content

Instantly share code, notes, and snippets.

@evantahler
Created April 22, 2016 20:44
Show Gist options
  • Save evantahler/6e1ef37d8d5d270c68aba7f25a1ab644 to your computer and use it in GitHub Desktop.
Save evantahler/6e1ef37d8d5d270c68aba7f25a1ab644 to your computer and use it in GitHub Desktop.
Delete the session cookie with ActionHero
'use strict';
exports.action = {
name: 'session-delete',
description: 'session-delete',
blockedConnectionTypes: [],
outputExample: {},
matchExtensionMimeType: false,
version: 1.0,
toDocument: true,
middleware: [],
inputs: {},
run: function(api, data, next){
var cookieName = api.config.servers.web.fingerprintOptions.cookieKey;
var oldDate = new Date(1).toUTCString();
data.connection.rawConnection.responseHeaders.push(['Set-Cookie', cookieName + '=X; expires=' + oldDate + '; path=/']);
next();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment