- Status
- Resolved
- Reported for
- WPML Multilingual CMS 3.6.3
- Resolved in
- 3.7.0
Overview of the issue
To solve certain issues with caching plugins we are no longer setting the language cookie on front-end when the user is not logged-in. This is causing some issues with certain themes and plugins which make AJAX calls on the front-end.
Workaround
The issue has been resolved in WPML 3.7.0.
To enable language information in front-end AJAX calls, go to WPML > Languages then scroll down until you see “Language filtering for AJAX operations”.
There you will find the “Store a language cookie to support language filtering for AJAX”:

What follows is the workaround for WPML 3.6.3:
If you are experiencing this issue and you are not using any caching plugin you can use the following workaround:
- Edit the sitepress-multilingual-cms/classes/utilities/class-wpml-cookie.php file.
- Change the set_cookie function
from:
public function set_cookie( $name, $value, $expires, $path, $domain ) {
if ( $this->should_set_cookie() ) {
setcookie( $name, $value, $expires, $path, $domain );
}
}
To:
public function set_cookie( $name, $value, $expires, $path, $domain ) {
setcookie( $name, $value, $expires, $path, $domain );
}