Skip to content

Commit 75df9e7

Browse files
Add more context to session replay section.
Address that this refactor prevents a user from being logged into multiple devices and browsers at one time. Highlight that the session store can be configured to use `mem_cache_store`. Issues ------ - Closes #36
1 parent c495713 commit 75df9e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,9 +1333,11 @@ end
13331333
13341334
## Step 18: Account for Session Replay Attacks
13351335

1336-
We're currently setting the user's ID in the session. Even though that value is encrypted, the encrypted value doesn't change since it's based on the user id which doesn't change. This means that if a bad actor were to get a copy of the session they would have access to a victim's account in perpetuity. One solution is to [rotate encrypted and signed cookie configurations](https://guides.rubyonrails.org/security.html#rotating-encrypted-and-signed-cookies-configurations). Another is to use a rotating value to identify the user.
1336+
**Note that this refactor prevents a user from being logged into multiple devices and browsers at one time.**
13371337

1338-
You can read more about session replay attacks [here](https://binarysolo.chapter24.blog/avoiding-session-replay-attacks-in-rails/)
1338+
We're currently setting the user's ID in the session. Even though that value is encrypted, the encrypted value doesn't change since it's based on the user id which doesn't change. This means that if a bad actor were to get a copy of the session they would have access to a victim's account in perpetuity. One solution is to [rotate encrypted and signed cookie configurations](https://guides.rubyonrails.org/security.html#rotating-encrypted-and-signed-cookies-configurations). Another solution is to use a rotating value to identify the user (which is what we'll be doing). A third option is to configure the [Rails session store](https://guides.rubyonrails.org/configuring.html#config-session-store) to use `mem_cache_store` to store session data.
1339+
1340+
You can read more about session replay attacks [here](https://binarysolo.chapter24.blog/avoiding-session-replay-attacks-in-rails/).
13391341

13401342
1. Add a session_token column to the users table.
13411343

0 commit comments

Comments
 (0)