-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Use an unpadded session. #2391
Use an unpadded session. #2391
Conversation
I'm hitting this issue a lot, but of course it is because I've been logging into other people's courses to help with this and that. There's one instructor here with two sections of a course, and this instructor likes to use one WW course for homework and a separate one for quizzes. They have certain global config settings different and find it easier to shut off access to HW that way during a scheduled test. So this instructor has four WW courses, which is the limit under this issue. It wouldn't be hard to imagine a need for this instructor to have a fifth one. So I think this is a good change. I'll try it out soon. |
5c6202c
to
75fe19e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this, I am able to log in to at least 12 courses without any issues. Not saying that is the cap I experienced, just that's how many I tried. Without this, it was usually 4. Sometimes it felt like I could enter a 5th, but then not succeed at navigating within that 5th.
c11897c
to
2ae271a
Compare
This changes the serialization method used by `Mojo::Sessions` to merely JSON encode the session without padding. The default serialization method JSON encodes the session and then pads it with the letter `Z` to a length of 1025 characaters. This results in much smaller session cookies (roughly one fifth the previous size). Thus it is possible to be signed in to more courses at a time without hitting the cookie size limit. This should perhaps only be considered if the limit on the number of courses that can be signed into at one time is deemed to be a big enough problem that something needs to be done.
2ae271a
to
37f3262
Compare
I think that we should go with this pull request. To be honest, I don't understand what the advantage of padding the session is, and I don't see any real downside to removing the padding. It seems that the padding just artificially inflates the cookie size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test with many courses, but I think let's merge.
This changes the serialization method used by
Mojo::Sessions
to merely JSON encode the session without padding. The default serialization method JSON encodes the session and then pads it with the letterZ
to a length of 1025 characaters.This results in much smaller session cookies (roughly one fifth the previous size). Thus it is possible to be signed in to more courses at a time without hitting the cookie size limit.
This should perhaps only be considered if the limit on the number of courses that can be signed into at one time is deemed to be a big enough problem that something needs to be done.