Skip to content

Commit bb0c85d

Browse files
committed
mobile banking session copy edit
1 parent a665404 commit bb0c85d

File tree

2 files changed

+32
-29
lines changed

2 files changed

+32
-29
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
- [Redis YouTube channel](https://www.youtube.com/c/Redisinc)
2-
- Clients like [Node Redis](https://github.com/redis/node-redis) and [Redis om Node](https://github.com/redis/redis-om-node) help you to use Redis in Node.js applications.
3-
- [RedisInsight](https://redis.com/redis-enterprise/redis-insight/) : To view your Redis data or to play with raw Redis commands in the workbench
2+
- Clients like [Node Redis](https://github.com/redis/node-redis) and [Redis OM Node](https://github.com/redis/redis-om-node) help you to use Redis in Node.js applications.
3+
- [RedisInsight](https://redis.com/redis-enterprise/redis-insight/): To view your Redis data or to play with raw Redis commands in the workbench
44
- [Try Redis Enterprise for free](https://redis.com/try-free/)

docs/howtos/solutions/mobile-banking/session-management/index-session-management.mdx

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: index-session-management
3-
title: Mobile banking authentication and session storage Using Redis
4-
sidebar_label: Mobile banking authentication and session storage Using Redis
3+
title: Mobile Banking Authentication and Session Storage Using Redis
4+
sidebar_label: Mobile Banking Authentication and Session Storage Using Redis
55
slug: /howtos/solutions/mobile-banking/session-management
66
authors: [prasan, will]
77
---
@@ -13,32 +13,36 @@ import MobileBankingDashboardBalance from './images/demo-dashboard-balance-widge
1313

1414
<MobileBankingSourceCode />
1515

16-
## What is Mobile banking authentication and session storage?
16+
## What is Authentication and Session Storage for Mobile Banking?
1717

18-
After an user has successfully entered their login credentials, mobile banking apps use an token / sessionId created by server to represent a user's identity. The token / sessionId is stored in Redis Enterprise for the duration of a user session and also sent in the login response to the banking application client (mobile/ browser). The client application then sends the token / sessionId with every request to server and server validates it before processing the request.
18+
After a user has successfully entered their login credentials, mobile banking apps use a `token` and `sessionId` created by the server to represent a user's identity. The `token` is stored in Redis for the duration of a user session and also sent in the login response to the banking application client (mobile/ browser). The client application then sends the `token` with every request to server and server validates it before processing the request.
1919

2020
![auth](./images/auth.png)
2121

22-
**Note** : Redis stack supports [JSON](/howtos/redisjson/) data type, indexing and Querying JSON and [more](https://redis.io/docs/stack/). So your Session store is not limited to simple key-value data.
22+
:::note
2323

24-
The session store houses critical information related to each user as they navigate an application for the duration of their session. Mobile banking session data may include following information
24+
Redis Stack supports the [**JSON**](/howtos/redisjson/) data type and allows you to index and querying JSON and [**more**](https://redis.io/docs/stack/). So your session store is not limited to simple key-value stringified data.
2525

26-
- User's profile information, such as name, date of birth, email address, etc .
27-
- User's permissions, such as “user,” “admin,” “supervisor,” “super-admin,” etc .
28-
- Other app-related data like recent transaction, balance etc .
29-
- Session expiration, such as one hour from now, one week from now, etc . and more
26+
:::
27+
28+
The session store houses critical information related to each user as they navigate an application for the duration of their session. Mobile banking session data may include, but is not limited to following information:
29+
30+
- User's profile information, such as name, date of birth, email address, etc.
31+
- User's permissions, such as `user`, `admin`, `supervisor`, `super-admin`, etc.
32+
- Other app-related data like recent transaction(s), balance etc.
33+
- Session expiration, such as one hour from now, one week from now, etc.
3034

31-
## Why you should Redis for Mobile banking session management?
35+
## Why you should use Redis for mobile banking session management?
3236

33-
- **Resilience**: Redis enterprise offers incredible resilience with **99.999% uptime**. After all, authentication token stores must provide round-the-clock availability. This ensures that users get uninterrupted, 24/7 access to their applications.
37+
- **Resilience**: Redis Enterprise offers incredible resilience with **99.999% uptime**. After all, authentication token stores must provide round-the-clock availability. This ensures that users get uninterrupted, 24/7 access to their applications.
3438

3539
- **Scalability**: Token stores need to be highly scalable so that they don't become a bottleneck when a **high volume of users** authenticate at once. Redis Enterprise provides **< 1ms latency** at incredibly high throughput (up to **100MM ops/second**) which makes authentication and session data access much faster!
3640

37-
- **Integration with common libraries and platforms**: Since Redis open source is integrated into most session management libraries and platforms, Redis Enterprise can seamlessly integrate when upgrading from open source Redis (For eg: express-session and connect-redis-stack libraries integration is demonstrated in this tutorial)
41+
- **Integration with common libraries and platforms**: Since Redis open source is integrated into most session management libraries and platforms, Redis Enterprise can seamlessly integrate when upgrading from open source Redis (e.g. `express-session` and [`connect-redis-stack`](https://www.npmjs.com/package/connect-redis-stack) libraries integration is demonstrated in this tutorial)
3842

3943
:::tip
4044

41-
Check our <u>[JSON Web Tokens (JWT) are Dangerous for User Sessions](https://redis.com/blog/json-web-tokens-jwt-are-dangerous-for-user-sessions/)</u> ebook for a secured session management practice.
45+
Read our ebook that answers the question: [**Are JSON Web Tokens (JWT) Safe?**](https://redis.com/docs/json-web-tokens-jwts-are-not-safe/) It discusses when and how to safely use JWTs, with battle-tested solutions for session management.
4246

4347
:::
4448

@@ -98,22 +102,22 @@ export const createBankTransaction = async () => {
98102
};
99103
```
100104

101-
Sample bankTransaction data view (in RedisInsight)
105+
Sample `bankTransaction` data view using [RedisInsight](https://redis.com/redis-enterprise/redis-insight/)
102106

103107
![bank transaction data](./images/bank-transaction-data.png)
104108

105109
![bank transaction json](./images/bank-transaction-json.png)
106110

107111
:::tip
108-
Download <u>[RedisInsight](https://redis.com/redis-enterprise/redis-insight/)</u> to view your Redis data or to play with raw Redis commands in the workbench. learn more about <u>[RedisInsight in tutorials](/explore/redisinsight/)</u>
112+
Download [**RedisInsight**](https://redis.com/redis-enterprise/redis-insight/) to view your Redis data or to play with raw Redis commands in the workbench. Learn more by reading the [**RedisInsight tutorial**](/explore/redisinsight/)
109113
:::
110114

111115
### Session configuration
112116

113117
Redis is integrated into many session management libraries, We will be using [connect-redis-stack](https://www.npmjs.com/package/connect-redis-stack) library for this demo which provides Redis session storage for your
114118
[express-session](https://www.npmjs.com/package/express-session) application.
115119

116-
Following code illustrates configuring Redis session and it's integration with express app.
120+
The following code illustrates configuring Redis sessions and with `express-session`.
117121

118122
```js title="app/server.js"
119123
import session from 'express-session';
@@ -147,9 +151,9 @@ app.listen(8080, () => console.log('Listening on port 8080'));
147151

148152
![login page](./images/demo-login.png)
149153

150-
Let's look in to the `/perform_login` API code which is triggered on the click of Login button from [login page](http://localhost:8080/)
154+
Let's look at the `/perform_login` API code which is triggered on the click of Login button from [login page](http://localhost:8080/)
151155

152-
Since [connect-redis-stack](https://www.npmjs.com/package/connect-redis-stack) session is configured in the express middleware, a session is automatically created at the at the end of the HTTP(API) response if `req.session` variable is assigned/ altered.
156+
Since [connect-redis-stack](https://www.npmjs.com/package/connect-redis-stack) is an express middleware, a session is automatically created at the start of the request, and updated at the end of the HTTP(API) response if `req.session` variable is altered.
153157

154158
```js
155159
app.post('/perform_login', (req, res) => {
@@ -172,7 +176,7 @@ app.post('/perform_login', (req, res) => {
172176
});
173177
```
174178

175-
In above code - `session.userid` variable is assigned with a value on successful login (for bob user), so a session is created in Redis with assigned data and only Redis key (sessionId) is stored in client cookie.
179+
In above code - `session.userid` variable is assigned with a value on successful login (for "bob" user), so a session is created in Redis with assigned data and only Redis key (sessionId) is stored in client cookie.
176180

177181
- Dashboard page after successful login
178182
![dashboard](./images/demo-dashboard.png)
@@ -187,9 +191,9 @@ Now on every other API request from client, [connect-redis-stack](https://www.np
187191

188192
### Balance API (Session storage)
189193

190-
Consider below `/transaction/balance` API code to demonstrate session storage.
194+
Consider the below `/transaction/balance` API code to demonstrate session storage.
191195

192-
We have to modify the `req.session` variable to add/ update session data.
196+
We have to modify the `req.session` variable to update session data.
193197
Let's add more session data like current balance amount of the user .
194198

195199
```js title="app/routers/transaction-router.js"
@@ -229,13 +233,12 @@ transactionRouter.get('/balance', async (req, res) => {
229233
className="margin-bottom--md"
230234
/>
231235

232-
## Ready to use Redis in session management ?
236+
## Ready to use Redis in session management?
233237

234-
Hopefully, this tutorial has helped you visualize how to use Redis for better session management. For additional resources related to this topic, check out the links below:
238+
Hopefully, this tutorial has helped you visualize how to use Redis for better session management, specifically in the context of mobile banking. For additional resources related to this topic, check out the links below:
235239

236240
### Additional resources
237241

238-
- [JSON Web Tokens (JWT) are Dangerous for User Sessions](https://redis.com/blog/json-web-tokens-jwt-are-dangerous-for-user-sessions/)
242+
- [Are JSON Web Tokens (JWT) Safe?](https://redis.com/docs/json-web-tokens-jwts-are-not-safe/)
239243

240-
- General
241-
<GeneralAdditionalResources />
244+
<GeneralAdditionalResources />

0 commit comments

Comments
 (0)