Session in Spring Boot application

Akhilesh :

My project is a springboot application with basic crud functionality with a login page using HTML and CSS only. How do I add session for login and logout

Dániel Kis :

It is recommended to use Spring Security.

You can find a lot of example if you search for "spring security tutorial" in google.

For instance it is an offical tutorial with angular js (1.x) https://spring.io/guides/tutorials/spring-security-and-angular-js/

If you don't want to use spring security you have to create a http session and store the logged in user data in http session.

In spring you can inject the HttpSession to your bean and you can add session attributes, or you can create a session scoped bean.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=467894&siteId=1