how to create a cookie and add to http response from inside my service layer?

前端 未结 4 843
天涯浪人
天涯浪人 2021-01-03 21:25

I am creating a custom authentication service in my spring mvc application:

@Service
public class AuthenticationServiceImpl implements AuthenticationService          


        
4条回答
  •  渐次进展
    2021-01-03 22:27

    To add a new cookie, use HttpServletResponse.addCookie(Cookie). The Cookie is pretty much a key value pair taking a name and value as strings on construction.

提交回复
热议问题