Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Cross-Domain Sessions with Ruby on Rails
Search
Lukas Fittl
January 09, 2014
Programming
1
440
Cross-Domain Sessions with Ruby on Rails
So, how does one write a Rails 4 session store?
Lukas Fittl
January 09, 2014
Tweet
Share
More Decks by Lukas Fittl
See All by Lukas Fittl
How to Scale Postgres - Automation, Tuning & Sharding
lfittl
0
600
What's Missing for Postgres Monitoring
lfittl
0
210
A Map For Monitoring PostgreSQL
lfittl
2
370
Monitoring Postgres at Scale
lfittl
1
390
Monitoring PostgreSQL at Scale
lfittl
4
230
Postgres Performance for App Developers
lfittl
2
260
GraphQL ❤ PostgreSQL -- P.S. aka BeatQL
lfittl
1
570
Hacking PostgreSQL to Gain SQL Parsing Superpowers
lfittl
1
540
PostgreSQL at a Web Startup
lfittl
3
570
Other Decks in Programming
See All in Programming
チームリードになって変わったこと
isaka1022
0
200
バックエンドのためのアプリ内課金入門 (サブスク編)
qnighy
8
1.8k
Formの複雑さに立ち向かう
bmthd
1
860
ARA Ansible for the teams
kksat
0
150
ファインディの テックブログ爆誕までの軌跡
starfish719
2
1.1k
Writing documentation can be fun with plugin system
okuramasafumi
0
120
GitHub Actions × RAGでコードレビューの検証の結果
sho_000
0
270
『品質』という言葉が嫌いな理由
korimu
0
160
Grafana Cloudとソラカメ
devoc
0
170
XStateを用いた堅牢なReact Components設計~複雑なClient Stateをシンプルに~ @React Tokyo ミートアップ #2
kfurusho
1
910
Pulsar2 を雰囲気で使ってみよう
anoken
0
240
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
150
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
The Cult of Friendly URLs
andyhume
78
6.2k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Embracing the Ebb and Flow
colly
84
4.6k
Automating Front-end Workflow
addyosmani
1368
200k
The Language of Interfaces
destraynor
156
24k
Designing for humans not robots
tammielis
250
25k
A designer walks into a library…
pauljervisheath
205
24k
It's Worth the Effort
3n
184
28k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.1k
Transcript
@LukasFittl Cross-Domain Sessions So, how does one write a Rails
4 session store?
Biz + UX + Dev @LukasFittl
So, 7 years ago we started this company: commit 2086c55b13426c2834f7060ad3739eed68e891c2
Author: Esad Hajdarevic <
[email protected]
> Date: Sun Mar 25 22:47:30 2007 +0000 ! Initial tags+trunk creation git-svn-id: svn://svn.phoria.eu/soup/trunk@1 c0834aa2-9929-0410-9117-c50b2a7daf23
Its still around :) ! But it runs Rails 2.3.
100+ hours later we’re (almost) on Rails 4.
Soooo... Sessions.
www.soup.io = Login/Logout/etc
mysoup.io = Soup Admin, Create Posts, etc
How can we make that work?
First thought: <iframe>
Actually, thats pretty painful.
What we ended up doing: www.soup.io mysoup.io Memcached / Redis
SESSION_ID REMOTE_SESSION_ID
Getting a REMOTE_SESSION_ID: http://mysoup.io/ => http://soup.io/remote/generate?host=mysoup.io (requested with main session
cookie YYY) ! => http://mysoup.io/?sessid=ZZZ SetCookie: soup_session_id=ZZZ ! => http://mysoup.io/ ! remote_session_link_ZZZ => mysoup.io--YYY Memcached / Redis
Lets look at the code :)
@LukasFittl Thank you! pganalyze.com