Refactor environment-specific session key and storage_id cookie constants#4267
Merged
Conversation
3b630de to
48eb4a8
Compare
Contributor
There was a problem hiding this comment.
The doubly nested #{ #{ } #} are hard to read and repeated on two lines.
Could you change this to:
env_suffix = "_#{rack_env}" unless rack_env?(:production)
KEY = "_learn_session#{env_suffix}"
STORAGE_ID = "storage_id#{env_suffix}"
Contributor
|
LGTM after comment is addressed. |
wjordan
added a commit
that referenced
this pull request
Sep 30, 2015
Refactor environment-specific session key and storage_id cookie constants
deploy-code-org
added a commit
that referenced
this pull request
Sep 30, 2015
commit 61b0b53 Merge: e5b2318 c115392 Author: Chris Pirich <chris@code.org> Date: Wed Sep 30 14:40:35 2015 -0700 Merge pull request #4273 from code-dot-org/playlab_annotations enable annotations for playlab, add clearRuntimeAnnotations() commit e5b2318 Merge: aad7706 d3089ea Author: Will Jordan <wjordan@users.noreply.github.com> Date: Wed Sep 30 14:28:56 2015 -0700 Merge pull request #4267 from code-dot-org/session_key Refactor environment-specific session key and storage_id cookie constants
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Our environment-specific cookie constants for session cookies (
'_learn_session_ENV') and storage_id ('storage_id_ENV') were being generated in several places throughout our codebase. This PR refactors several of these instances into theSession::KEYandSession::STORAGE_IDconstants to keep track of them a bit more easily moving forward.Prerequisite to #4207.