Skip to content

Instantly share code, notes, and snippets.

Avatar

Kalys Osmonov kalys

View GitHub Profile
@kalys
kalys / Readme.md
Created Oct 30, 2017 — forked from JoshCheek/Readme.md
Decrypting a Rails (v4.2.0) session
View Readme.md

How to get the values

Salts

$ rails runner 'Rails.application.config.action_dispatch.tap { |c| p encrypted_cookie_salt: c.encrypted_cookie_salt, encrypted_signed_cookie_salt: c.encrypted_signed_cookie_salt }'

Secret Key Base

View uploader.js
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://image.torrent.kg/images/U8x5261.png', false);
xhr.responseType = 'arraybuffer';
xhr.send();
var blob = new WebKitBlobBuilder();
blob.append(xhr.response);
var file = blob.getBlob('image/png');
console.log(file)
var fd = new FormData();
fd.append("image[0]", file);