how to set cookie on browser side through java action

0
i want to set cookie on browser side through java action 
asked
3 answers
0

Why do you want to set a cookie, are you absolutely sure this is necessary?

 

I believe the only way you can set a cookie is by directing the user to a custom request handler. You could use the URL redirector widget (https://appstore.home.mendix.com/link/app/113/Mendix/URL-Redirector) to direct a user to the request handler. In the request handler, you have access to request.addCookie() methods.

answered
0

So if i am getting session token through rest service , how can i set that session token in cookie? 

how can i set that as user session?

This cookie will be used by other mendix app too

answered
0

I think what you're doing architecturally does not make sense. If this cookie is for authenticating a user session, it should be handled through a request made by the browser. If the cookie is just for service calls and you're using the RestServices module, you can get the cookie using the Java actions "getResponseCookies" and then "addRequestCookies" for subsequent calls.

answered