Page 1 of 1

Session handling in VisionX Webapp

PostPosted: Mon Aug 19, 2019 8:36 am
by loknath
Hi I wanted to save some attribute in session and then i am redirecting to google for authorization(https://www.googleapis.com/oauth2/v1/userinfo). Later from saved attribute i want to perform some more task.

Code: Select all
HttpContext hctxt = HttpContext.getCurrentInstance();
Object request = hctxt.getRequest();
   
//final GoogleAuthHelper helper = new GoogleAuthHelper();
if(((ServletRequest) request).getParameter("code") != null && ((ServletRequest) request).getParameter("state") != null)
{
    if (request instanceof HttpServletRequest)
    {
        tmp = ((HttpServletRequest)request).getHeader("User-Agent");
        tmpsession = ((HttpServletRequest)request).getSession().getId();
        System.out.println(tmp + "/br " + tmpsession);
        //helper.getUserInfoJson(tmpsession);
     }
}

Re: Session handling in VisionX Webapp

PostPosted: Mon Aug 19, 2019 10:35 am
by Support@SIB
Simply put your properties into the launcher. Set preserve on refresh enabled.The application is saved in the http session and your properties are available in your application.

Re: Session handling in VisionX Webapp

PostPosted: Mon Aug 19, 2019 12:00 pm
by loknath
Do we have any sample tutorials or code to do same. I am new to VisionX :?:

Re: Session handling in VisionX Webapp

PostPosted: Fri Aug 23, 2019 12:15 pm
by Support@SIB
The preserveOnRefresh is documented here.

With VisionX, use the Web application settings wizard to set this feature.

Re: Session handling in VisionX Webapp

PostPosted: Mon Aug 26, 2019 11:54 am
by Support@SIB
To put custom properties, use following documentation.