最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - How to get device id in react js based web application? - Stack Overflow

matteradmin7PV0评论

I'm developing a reactjs based application. I want to limit the login from multiple devices at one time to an account. So I need to have an ID that is unique and fixed on device.

I also want the user to stay logged in on one device, so I can not use IP address.

Also, I've already limited access from several browsers.

Thanks a lot. Also, sorry for my English.

I'm developing a reactjs based application. I want to limit the login from multiple devices at one time to an account. So I need to have an ID that is unique and fixed on device.

I also want the user to stay logged in on one device, so I can not use IP address.

Also, I've already limited access from several browsers.

Thanks a lot. Also, sorry for my English.

Share Improve this question edited Jun 10, 2019 at 14:40 Abbas Habibnejad asked Jun 10, 2019 at 14:21 Abbas HabibnejadAbbas Habibnejad 4431 gold badge5 silver badges14 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 2

This check can't be implemented on client side of the application.

On the server end, you can get IP address from requested payload. You can store the IP address against the session in In-memory databases like redis or memcache. Now, create an intermediate check at login controller where you can block the user if he/she has logged in more than certain number of IP addresses.

Post a comment

comment list (0)

  1. No comments so far