Created
April 22, 2016 20:44
-
-
Save evantahler/6e1ef37d8d5d270c68aba7f25a1ab644 to your computer and use it in GitHub Desktop.
Delete the session cookie with ActionHero
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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