Search code examples
sessionsession-cookiesoffice-jsoffice-addins

Session cookie across task pane and dialog


This page describes the authentication process for an Office add-in. It states that, for the dialog:

It does not share the same session storage as the task pane

This does not seem to match my experience. This is what I'm doing:

  • Task pane opens dialog with displayDialogAsync
  • User logs in with the dialog and a session cookie is set in the dialog.
  • Without passing any info to the parent (messageParent is not used), the task pane then has the session cookie set.

Is the documentation here have a mistake? Or is the session shared on some platforms but not on other platforms? I'm on Mac with Office 365.


Solution

  • That line in the documentation refers to the Window.sessionStorage property. Cookies and server-side storage can be shared between the dialog and the host page. I'll get the documentation clarified.