Comments (5)
According to the Yesod book, the default session store is cookie like Rails http://www.yesodweb.com/book/sessions
I still think that there may be issues with cross-dyno access to it, but maybe we can solve it through configuration.
from carnival.
For reference, here's is the framework code: https://github.com/yesodweb/yesod/blob/master/yesod-core/Yesod/Core/Internal/Session.hs
And here is the library it delegates most of the work to: http://hackage.haskell.org/package/clientsession-0.9.0.3/docs/Web-ClientSession.html
I just realized that the session key is stored on the filesystem in ./config/client_session_key.aes
. I believe the key is randomly generated as needed. Since we don't store this file in VCS and heroku's file systems are ephemeral, it's different on each dyno (and every restart). I'm not sure there's a way to configure the framework to read the key from an environment variable -- I may open an issue, once we confirm this is the problem, and take a swing at a PR to make it possible.
As a workaround we could commit the file for now.
from carnival.
Yeah, ok - Here is a thread about overriding the session backend behavior
https://groups.google.com/forum/#!searchin/yesodweb/session$20key/yesodweb/Ocbz83hiLB4/L9jo45KB_DEJ
from carnival.
Hmm, promising. I wonder if it's as easy as...
makeSessionBackend _ = fmap Just $ do
let minutes = (120 * 60) -- 120 minutes
key <- -- Something custom that reads an environment variable
let timeout = fromIntegral (minutes * 60)
(getCachedDate, _closeDateCacher) <- clientSessionDateCacher timeout
return SessionBackend
{ sbLoadSession = loadClientSession key getCachedDate "_SESSION"
}
Unfortunately, I don't think the key value is a simple string (like Rails), so using an environment variable could require a bit more.
from carnival.
This was done and pushed mid-week.
from carnival.
Related Issues (20)
- Add copy to the homepage
- article_selector with id HOT 3
- Please add type="text/javascript" to the script tags HOT 3
- Make it possible to delete comments HOT 4
- Not working on my site HOT 4
- HTML is unescaped HOT 2
- Unsubscribe may be broken HOT 6
- Syntax error on docs page HOT 1
- Official tutorial for VPS HOT 1
- Consider replacing helper with middleware
- Experiment with Heroku Docker
- Set up Airbrake for 500 errors
- Comment feed contains bogus article URL due to omitting forward slashes
- Comments not working for bottom half of blog post HOT 1
- yesod devel fails on master
- New Comment button not appearing at certain screen sizes HOT 1
- 'Authentication Error' with github sign-in HOT 7
- Comments visually overflowing onto footer HOT 1
- Horizontal overflow for long strings
- Use free SSL option on Heroku?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carnival.