You are here:
Step 4: Write Login and Logout Functions
On the web page, provide a login and optional logout JavaScript function in the body to
handle onLogin and onLogout events. With these functions, you determine what happens when users log in
and out successfully. You have full control over what happens.
Embedded Login relies on third-party cookies, which are blocked or restricted in most browsers. And Embedded Login works only on Google Chrome and only as long as third-party cookies are allowed there by default.
- Add a login function to the body of the web page.
- Optionally, add code to the login function to retrieve user information from Salesforce.
- Optionally, add a logout function to the body of the web page.

