Implement HttpSession into Cuba workflow

Hi, how do you do?

I have a little doubt about how can I implement HttpSession through the process flow? Or maybe know if it’s possible and how to storage another users and passwords at the running time.

I want to login through a web service, and I can do it, but I want to storage the session response into a HttpSession or storage the response as a user and password of Cuba.

If you need to store temporary data in a given user’s session, CUBA suggests to use UserSession attributes.
See here: UserSession - CUBA Platform. Developer’s Manual

UserSession can be injected to any screen.


    private UserSession userSession;


    public void onBtnClick(Button.ClickEvent event) {
        userSession.setAttribute("extensionNumber", "03");

When coding in core module, you can inject UserSessionSource and obtain current user session from it.