Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deferred Causes A Session to be Created for All Page Views #10

Open
coofercat opened this issue Mar 8, 2017 · 2 comments
Open

Deferred Causes A Session to be Created for All Page Views #10

coofercat opened this issue Mar 8, 2017 · 2 comments

Comments

@coofercat
Copy link

I've been working with Dancer2 and Deferred for a project. I've noticed that Deferred seems to cause a session to be created for every visitor, even if no deferred message is shown.

This means that every visitor causes a session to be created. In my case it's Redis backed, so the session creation cost is small, and having a large number of sessions in Redis isn't a big burden. However, making a session for a user who (will probably) never need it, and (unless they're in a very small percentage of visitors) will never see a Deferred message seems rather wasteful.

This also causes me a slight issue with the EU cookie laws, in so much as when a visitor arrives at my site, I'll be setting a cookie (the session cookie) at the same time as I'm asking if it's okay to do so.

Is there a way Deferred could avoid creating the session, unless an actual 'deferred' call is made?

@Asuza
Copy link

Asuza commented Jan 30, 2018

@coofercat were you able to find a solution to your problem?

@coofercat
Copy link
Author

No, I didn't - other than "don't use Deferred" :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants