Background of the issue:
When logged in to wp-admin but viewing in a different language (so the url has &lang=)
If the WP auth cookie expired, WP will show a overlay for login. However the wp-login.php URL is not for the current URL but for the currently selected language.
e.g. 2 languages en and fr on example.com and example.fr
example.com/wp-admin/edit-tags.php?taxonomy=user_tag&trid=0&source_lang=en&lang=fr&admin_bar=1
In WPML->Languages-> enable the feature "Auto sign-in and sign-out users from all domains", does that help resolve the issue of needing to login to each domain separately?
I understand the issue you are having, however, are you able to resolve it by using the feature I mentioned as a workaround? It is important to test this to debug this issue thoroughly and to give our team a deeper idea of what might be causing this.
NOTE: I am also updating our team about the bug you are experiencing so we can further review it.
I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)
**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **
I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.
NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.
When you say "However the wp-login.php URL is not for the current URL but for the currently selected language."
If you have the French language selected since you are using different domains per language the URL will indeed be .fr .
Since you are signed out at that moment the system will not recognize the user rather simply just that you need to log in again therefore it prompts using the URL at hand.
After speaking with our team we should raise this as a feature request as it is not classified as a bug with WPML.
Pleas read the original description again. This has nothing to do with "recognizing the user". The incorrect URL is already printed at a time the user is still logged in (otherwise I wouldn't be able to access wp-admin in the first place)
Current URL: hidden link
On this page (I am on .com) it outputs (check dev tools): hidden link
Therefore, when the session expires, it will ask me to login on example.fr even though I am example.com
This is a bug. You output the wrong URL based on the fact that the lang=fr is in the URL.