The control <vtex.cmc:welcomeMessage/>
renders a welcome message, which should be used in the store topbar.
See an example in the image below.

HTML code rendered
Here is an example of the code rendered by this control:
<div class="welcome col-xs-5"> <script> $(document).ready(function () { vtexid.setScope('1acde8b8-c134-45ca-bda6-8496f39d6734'); vtexid.setScopeName('lojadobreno'); $('body').on('click', '#login', function () { vtexid.start( { returnUrl: '/produto-teste/p', userEmail: '', locale: 'en-US', forceReload: false }); }); }); </script> <div class="ajax-content-loader" rel="/no-cache/user/welcome"> <p class="welcome"> Bem-vindo! <em><a id="login">Já é cadastrado? </a></em> </p> </div></div>
Login trigger script
Note that the control renders an HTML code with the welcome message and also a script.
This script is triggered when the user clicks on the element with ID "login"
, which by default comes with the message "Já é cadastrado?" ("Already registered?"), and is responsible for taking the user to the login screen.
Cookie
The script rendered by the control also creates a cookie responsible for informing the store that the user is logged in.
Other VTEX services use the same cookie (for example, product reviews), so they don't need to ask the user to sign in again.
See in the example script above that the method which creates this cookie is vtexid.setScope()
.
Still following the example above, the cookie created would be the following: UserGUID=1acde8b8-c134-45ca-bda6-8496f39d6734