This project is archived and is in readonly mode.
[PATCH] 2.3.2 need a way to check if a session exists without creating one
-
Johan Sørensen
- Title changed from 2.3.2 need a way to check if a session exists without creating one to [PATCH] 2.3.2 need a way to check if a session exists without creating one
- Tag set to cookies, session
I couldn't agree more. Attached is a patch series that only writes to the session store if the SessionHash setter was accessed.
As a bonus, there's also a patch for not saving to the session when the flash content is empty.
The upside of both of these is that it's not setting any cookies (eg. user not logged in etc), which makes things quite easier for edge-proxies
-
Johan Sørensen
Second part of the patch
-
josh
- Milestone cleared.
- State changed from new to open
- Assigned user set to josh
-
Repository
- State changed from open to resolved
(from [dc94c095031036ffc0f9ac0ee98a1162e57062eb]) The FlashHash and friends causes a lot of needless session storing, when we know for a fact that there's no content in the flash. By not storing the empty hash in the session we save a lot of communication with the various session backends, while still keeping the same interface to the flash. [#2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/dc94c095031036ffc0f9ac0ee98a11... -
Repository
(from [14edaa104de7b71a4cd11b03121c911ce221b813]) Only save the session if we're actually writing to it [#2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/14edaa104de7b71a4cd11b03121c91... -
Repository
(from [72cb6f58be6590ac2590eea420a1b3ef175189b3]) The FlashHash and friends causes a lot of needless session storing, when we know for a fact that there's no content in the flash. By not storing the empty hash in the session we save a lot of communication with the various session backends, while still keeping the same interface to the flash. [#2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/72cb6f58be6590ac2590eea420a1b3... -
Repository
(from [dd98280e38d640f5724887cf8a715b79f0439d2d]) Only save the session if we're actually writing to it [#2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/dd98280e38d640f5724887cf8a715b... -
Sam Ruby
There is a problem. If the session contains any sort of mutable object, and that object is retrieved using the SessionHash getter and then updated, then the session is not guaranteed to be stored.
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets...
I'd like to request that the change be backed out and this ticket reopened.
-
Johan Sørensen
facepalm
That's quite a gaping hole indeed, I suggest reverting the commits as well until I (or someone else) come up with a better patch.
-
Repository
(from [c73cf7d2c0d164d819a483c83302cd4a62ca24b9]) Revert "Only save the session if we're actually writing to it [#2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one state:resolved]"
This reverts commit 14edaa104de7b71a4cd11b03121c911ce221b813.
http://github.com/rails/rails/commit/c73cf7d2c0d164d819a483c83302cd... -
Repository
(from [a1140a10318a79b5dace11679f654c33f477ef57]) Revert "Only save the session if we're actually writing to it [#2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one state:resolved]"
This reverts commit dd98280e38d640f5724887cf8a715b79f0439d2d.
http://github.com/rails/rails/commit/a1140a10318a79b5dace11679f654c...
