Skip to content

Commit

Permalink
Fix missing logic in quickstart example (#8693)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewUserHa authored Aug 15, 2024
1 parent 92e14f8 commit 7ca244e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/web_quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,11 @@ third-party library, :mod:`aiohttp_session`, that adds *session* support::

async def handler(request):
session = await get_session(request)
last_visit = session['last_visit'] if 'last_visit' in session else None
text = 'Last visited: {}'.format(last_visit)

last_visit = session.get("last_visit")
session["last_visit"] = time.time()
text = "Last visited: {}".format(last_visit)

return web.Response(text=text)

async def make_app():
Expand Down

0 comments on commit 7ca244e

Please sign in to comment.