iFrames and Sessions #1812
Replies: 2 comments
-
Thank you for posting. Sorry, This question is difficult for me. |
Beta Was this translation helpful? Give feedback.
-
There are some historic issues with iFrames, which are generally frowned upon for such reasons. Without seeing any code a guess would be that you're experiencing this due to the SameSite by default setting in modern browsers (Chrome as of early 2020), and while you can alter those settings it's unwise to do so. A better solution would be to not use an iFrame at all, an element which you update via AJAX calling your Mojo back end would seem like a better solution. See also Writing websocket chat using Mojolicious Lite |
Beta Was this translation helpful? Give feedback.
-
Hi All
We have a small mojolicious application spread over a number of microservices. We process millions of data records and 10s of millions images every month using Minion, a very big thank you to the core team and inventors of mojolicious.
Now we have been asked to add a chat to a couple of frontends so I'm doing a prototype for this, the idea is to show the chat in a iFrame in the frontend. Its no problem to show the HTML generated by the chat service, based on jberger/mojo_chat.pl, in the iFrame. The problem I have encountered is that when I do something that triggers a call to the back end the session is empty, it exists in the browser but is not transmitted back to the service.
So my question is if there is any settings or something else to make sure the session is included in the response to the service ?
If I open the page shown in the iFrame in a browser everything works fine.
Mojolicious 9.19
Perl 5.30.1
Google Chrome
MithrilJS 1
Thank you in advance !
Best Regards
Jan
Beta Was this translation helpful? Give feedback.
All reactions