我想知道是否有办法告诉 TYPO3 在不同域之间共享会话/cookie?
我们在多语言/多域站点上编写了 Extbase 扩展。我们将搜索表单中的搜索词存储在用户会话中。如果用户切换页面语言,他应该得到与以前相同的结果——无需重新填写搜索表单。
一种方法是告诉浏览器同时存储多个 cookie - 每个域/语言一个。TYPO3 / Extbase 如何做到这一点?
我想知道是否有办法告诉 TYPO3 在不同域之间共享会话/cookie?
我们在多语言/多域站点上编写了 Extbase 扩展。我们将搜索表单中的搜索词存储在用户会话中。如果用户切换页面语言,他应该得到与以前相同的结果——无需重新填写搜索表单。
一种方法是告诉浏览器同时存储多个 cookie - 每个域/语言一个。TYPO3 / Extbase 如何做到这一点?
By default, there is no way to set cookies for a different domain - not with or without TYPO3. This is a security measure implemented in every browser (or do you want me to set / read your cookies from yourbank.com when you visit my web site? ;-))
You have to create some helper script that does this for you. One way could be:
I have never tried this, but I'm pretty sure it will work with PHP. Maybe it's even possible with pure JavaScript, but I'm not so sure. In every case, think about what security holes you get with the explained script. In doubt sign the parameters (or require a token)!