简体   繁体   中英

How to verify two different browsers on the server using spring-boot?

I am using react js for front end and spring boot for backend. Now, I have a situation where I need to get some kind of browser signature or browser specific information to store on the server so that from every new request, I can verify if user is hitting URL from the same browser or from some other browser.

I have tried serveral ways to get browser specific information at backend but not succeed. Please guide me which browser specific information, I can send get in my spring-boot URL and then store that for further verification process.

Thanks in advance!

I would try to set cookies on the client browser and track the cookie/session value on the server side.

For example you can set the cookie-

// create a cookie
Cookie cookie = new Cookie("someUniqueValueLike", uuid);
//add cookie to response
response.addCookie(cookie);

Read cookie

public String readCookie(@CookieValue(value = "someUniqueValueLike") String uuidString) {
    //verify the cookie value here
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM