Skip to content

Commit 785fbc6

Browse files
committed
fix typo error and improve sentence
1 parent 87f272c commit 785fbc6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

working-with-session/index.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ There is two mechanism where session initialization and serialization can be don
229229

230230
When using dispatcher for working with session, session is initialized after request object is created and serialized to storage before response is sent to client over the wire. So session is always applied globally through out application.
231231

232-
When using middeware for working with session, session is initialized when middleware is attached globally to application middleware list or per route. Using middleware when working with session is more flexible. For example you may want to apply session management only for certain routes and not other.
232+
When using middleware for working with session, session is initialized when middleware, which is attached globally to application middleware list or per route, is executed. Using middleware when working with session is more flexible. For example you may want to apply session management only for certain routes and not other.
233233

234234
## Create dispatcher instance which support session
235235

@@ -259,24 +259,26 @@ container.add(
259259
Please read [Dispatcher](/dispatcher) for more information or you may want to get information about [how to create Fano web application project with session using Fano CLI](/scaffolding-with-fano-cli#add-session-support).
260260

261261
## Session middleware
262-
Since v1.10.0, Fano Framework provides session middleware `TSessionMiddleware` which can be use as alternative to using dispatcher when working with session. `TSessionMiddlewareFactory` class is factory class for this middleware.
262+
Since v1.10.0, Fano Framework provides session middleware `TSessionMiddleware` which can be use, as an alternative to using dispatcher when working with session. `TSessionMiddlewareFactory` class is factory class for this middleware.
263263

264264
```
265265
container.add(
266266
'my.session.middleware',
267267
TSessionMiddlewareFactory.create(
268-
container.get('sessionManager') as ISessionManager
268+
container['sessionManager'] as ISessionManager
269269
)
270270
);
271271
```
272272

273-
To apply session middleware globally so that session is initialized and serialized through out application. If you attach middleware as first middleware to run globally, it is similar compare to when using dispatcher.
273+
To apply session middleware globally, so that session is initialized and serialized through out application.
274274

275275
```
276276
(container['appMiddlewares'] as IMiddlewareList)
277277
.add(container['my.session.middleware'] as IMiddleware);
278278
```
279279

280+
It is similar to using dispatcher.
281+
280282
To apply session middleware so that session is only initialized and serialized when certain routes is accessed, attach middleware to route.
281283

282284
```

0 commit comments

Comments
 (0)