A family of Microsoft word processing software products for creating web, email, and print documents.
Thank you for reaching out to Microsoft Q&A Forum.
It sounds like the "Session Expired" error after saving comments through WOPI might be related to how the comment timestamps are being handled in the document.
From what you've described, the original comment was added at 7:03 PM, but after saving and reopening the document, the timestamp appears to have shifted to 12:03 PM. This kind of discrepancy can sometimes cause Office Online to invalidate the editing session, especially if the timestamp format or timezone is inconsistent with what the WOPI host or Office expects.
Here are a few things you might want to review:
-Make sure the comment timestamps are in valid ISO format (yyyy-MM-ddTHH:mm:ssZ) and ideally in UTC.
-Confirm that the WordprocessingCommentsPart is being written correctly when saving the document. Missing or malformed comment metadata (like author, date, or id) can cause Word to treat the document as corrupted.
-Compare the document content before and after the PutFile call to see if the timestamp or comment structure is being altered unexpectedly.
-Review the CheckFileInfo response to ensure fields like LastModifiedTime and UserCanWrite are being updated properly.
If the issue only occurs when comments are present, it’s likely tied to how that part of the document is being handled during the save operation.
I hope this helps. Please let me know if you get a chance to try them out.
If the answer is partially helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.