question

Nagendra-9029 avatar image
0 Votes"
Nagendra-9029 asked MichaelHan-MSFT edited

User session handling in SPFx webpart

Hi,

We have requirement for to show the Terms and conditions popup when user login to the portal.

The pop-up with the T&Cs will come up when user login for the first time during that session and should not come up again during that session.

Already i have logic for popup(fluent ui Dialog) in spfx webpart, need help in session handling in between user login and logout.


Regards,
Nagendra.

office-sharepoint-server-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered MichaelHan-MSFT edited

Hi anonymous user-9029,

As far as I know, it's impossible to handle user session through SPFx. SPFx code are front code runing in the browser, the code will gone when the browser i closed.

As a workaround, you could create a custom list to store the user infromation. In the spfx web part, check if the user is in the list(login for the first time), if not show the popup then add the user to that list.


If an Answer is helpful, please click "Accept Answer" and upvote it.
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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

anonymous user-9029,
Is there anything update? I am wearing to hear from you.

0 Votes 0 ·