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
Reported by trevor | May 24th, 2009 @ 03:23 AM
there doesn't seem to be a way to check if a session already exists without lazy-loading a new session.
Comments and changes to this ticket
-
Johan Sørensen May 27th, 2009 @ 02:27 PM
- 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
-
josh May 28th, 2009 @ 03:11 PM
- Milestone cleared.
- State changed from new to open
- Assigned user set to josh
-
Repository May 28th, 2009 @ 03:35 PM
- 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 state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/dc94c095031036ffc0f9ac0ee98a11... -
Repository May 28th, 2009 @ 03:35 PM
(from [14edaa104de7b71a4cd11b03121c911ce221b813]) Only save the session if we're actually writing to it [#2703 state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/14edaa104de7b71a4cd11b03121c91... -
Repository May 28th, 2009 @ 03:35 PM
(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 state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/72cb6f58be6590ac2590eea420a1b3... -
Repository May 28th, 2009 @ 03:35 PM
(from [dd98280e38d640f5724887cf8a715b79f0439d2d]) Only save the session if we're actually writing to it [#2703 state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/dd98280e38d640f5724887cf8a715b... -
Sam Ruby May 30th, 2009 @ 04:12 AM
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 May 30th, 2009 @ 11:29 AM
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 May 30th, 2009 @ 03:36 PM
(from [c73cf7d2c0d164d819a483c83302cd4a62ca24b9]) Revert "Only save the session if we're actually writing to it [#2703 state:resolved]"
This reverts commit 14edaa104de7b71a4cd11b03121c911ce221b813.
http://github.com/rails/rails/commit/c73cf7d2c0d164d819a483c83302cd... -
Repository May 30th, 2009 @ 03:37 PM
(from [a1140a10318a79b5dace11679f654c33f477ef57]) Revert "Only save the session if we're actually writing to it [#2703 state:resolved]"
This reverts commit dd98280e38d640f5724887cf8a715b79f0439d2d.
http://github.com/rails/rails/commit/a1140a10318a79b5dace11679f654c...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one (from [dc94c095031036ffc0f9ac0ee98a1162e57062eb]) The Fla...
- 2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one (from [14edaa104de7b71a4cd11b03121c911ce221b813]) Only sa...
- 2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one (from [72cb6f58be6590ac2590eea420a1b3ef175189b3]) The Fla...
- 2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one (from [dd98280e38d640f5724887cf8a715b79f0439d2d]) Only sa...
- 2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one (from [c73cf7d2c0d164d819a483c83302cd4a62ca24b9]) Revert ...
- 2703 [PATCH] 2.3.2 need a way to check if a session exists without creating one (from [a1140a10318a79b5dace11679f654c33f477ef57]) Revert ...