Comments (3)
That's probably because you're using the inmemory interface. Each worker will have it's own set of sessions. Ideally, all workers should share the same set of sessions. Try using any of the other storage interfaces instead instead. E.g. Redis
from sanic-session.
Thank you, Omar @omarryhan. That is true.
Session mechanic have few connected parts. You give user special very random number. That is hard or impossible to predict. And on the server side it used as key for user storage with all his/her session data. You need place where you store that data. You definitely can store inside the current process memory, but that means that other processes doesn't have any access to that data. That is why we warn everywhere with comment suitable for testing and development environments
.
Best practice use Redis. It is suitable for most cases with default settings. Unless you have more data than free memory on Redis server.
I don't think there is much to add with this ticket. So, I will close it. But if you think that it is important to know to other Chinese-speaking users you can help project by adding some documentation in separated pull request.
from sanic-session.
Thanks,I understood it.
from sanic-session.
Related Issues (20)
- session does not save values (Sanic 20.3.0) HOT 2
- Update the release on PyPI HOT 2
- Document mongodb support? HOT 1
- AttributeError: 'NoneType' object has no attribute 'name' HOT 1
- UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 2490: character maps to <undefined>
- Unknown overflow error HOT 4
- Session doesn't save HOT 8
- sys:1: RuntimeWarning: coroutine 'Loop.create_server' was never awaited
- Redis asyncio_redis example returns 403(timeout)
- How to use mongodb interface? HOT 1
- instance extensions question HOT 2
- Redis always “TimeoutError: [Errno 110] Connection timed out” HOT 1
- seems response header always has set-cookie, even use same session HOT 6
- aioredis example error in sanic 22.9.0 HOT 1
- Transfer of project HOT 2
- Why does this piece of code work? HOT 2
- Middleware addition is broken on sanic 22.12.0+ HOT 1
- Make the usage of json implementation configurable
- aioredis is now in redis >= 4.2
- this is base plugins, need to be more stable, more communal.
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 sanic-session.