Browser sessions in AdonisJS

Browser sessions in AdonisJS

39mins
8 lessons
Intermediate
Start course

With the growing number of devices and browsers available these days, it's not uncommon for users to be logged in to your application on multiple devices/browsers. You might need to allow users to keep track of their browsers sessions and even ways to log out from certain browsers or all browsers. In this course, you are going to learn how to implement browser (or log in) sessions in AdonisJS.

What you'll learn

  • How to track and save users' browser sessions
  • Display users' browser sessions
  • How to log out from a specific browser session
  • How to log out from all other browser sessions
  • How to ensure only one login session for users
  • How to log out from all sessions after password update or reset

Browser sessions

In this lesson, you are going to learn how to track users browser sessions by saving them in the database.

In this lesson, we cover how to display users' browser sessions. You will also learn our to parse user agent.

In this lesson, we cover how to track when login sessions are last active at.

Now, let's look at how to log users out from specific browser sessions.

There are times users would want to log out from all but their current session. In this lesson, you'll learn how to do that.

In cases where users account might have been compromised, the users might want to reset their passwords and also log out from all existing sessions so as to kick the attacker out. In this lesson, you'll learn how to allow users to log out from all their login sessions.

In this lesson, you'll learn how to enforce only one login session for users.

To wrap up this course, let's fix a tiny bug in our application which has to do with session records not being deleted when the standard log out functionality is used.

Chimezie Enyinnaya

Hi, I'm Chimezie Enyinnaya, your teacher.

I’m a self-taught software developer based in Lagos, Nigeria, with over 8 years of experience. In the last couple of years, I've been doing more teaching because I enjoy sharing my knowledge so that others can benefit from it. Come along as I teach you all I know about AdonisJS, Node.js, and JavaScript at large!