Knowledge Base

Welcome to the SmarterCommerce documentation portal

What can we help you find?

SMARTERCOMMERCE

Search and Learn about Unified Commerce and Our SmarterCommerce Solutions
Digital Commerce Additional Manual

Session Expired Plugin


This plugin has been created to notify the user with a message when they have been logged out due to session expiration. The process will redirect to the Login Page configured and the message will be displayed. It works against two authentications, the Sitefinity authentication and the SmarterCommerce one. 

The process first validates that the session is not already expired. If the session is expired, the timeout is not validated but if the session is active, a request to the server is done to obtain the session time. If the user is logged into Sitefinity, the configuration is obtained from the following path: Administration -> Settings -> Advanced -> Security -> AuthCookieTimeout.

If the user is logged in with SmarterCommerce, session time is obtained from the HttpContext.Current.Session, which is the configuration of the web.config for Sitefinity website. It is recommended that the configuration of the time out of Sitefinity is less than that of the web config. For more information about the configuration go to section “Sitefinity Authentication Expiration”

If the Sitefinity timeout expires and the SmarterCommerce timeout is still valid while browsing the site, the plugin is validated against the configuration in the web config. 

Once the time count reaches its end, the status of the time expiration is validated, and it proceeds to redirect to the Login page where a query string parameter is added in the URL “expired=True” to validate whether it is necessary to perform the validation of the timeout.

This control can be used only on internal pages. Continue reading for more information. 

If the plugin will be used on an external page, follow the steps in CMS - JQuery Plugins.docx

 

Apply Session Expired on Internal Pages

Integration jQuery Plugin

  1. Got to the Content Blocks (Top Menu -> Content/Content Blocks).

 

2. Next, create a new Content Block. Click on Create a Content Block button.

 

3. In the Create view:

a.  Add a Title

b. In the content field

  • In the Editor text, you will find a custom ToolBarItem to add the HTML structure, open the options in the SmarterCommerce button and select the option “Session Expired”.

     

  • Note: on some monitors, the SmarterCommerce option appears within the dot’s menu with the name “exe”. (This name is fixed in update 7)

 

4. To view and modify the HTML structure click the option, then find the Code Review.

5. Modify the HTML. Add the values for data-shopping-url with the absolute URL of the site.

6. Click on Create and the Content Block configuration is finished.

 

Implementation Example

1.      Now, add a Content block widget to the page where you want to display the plugin. The recommendation is to add the content block in the page template (Design > Page Templates).

a. Navigate to Page template and select the template where the content will be added. Recommentaiton is the Ecommerce template. 

b. Add a Content block widget to the page template. The content block can be added in any section, but it is recommended to add it at the top of the page.

 

2. On the Content block, click on “More” menu and select “Use shared”. Select the content block previously created and click Done selecting.

3. Add the link to the session expired plugin using a javascript plugin widget.

a.      Add Javascript widget into the Head_JavaScripts_PlaceHolder section in the page template.

 

b. Select the js file from resources files.

URL: ~/ResourcePackages/Bootstrap4/MVC/Scripts/sc-jquery.sessionexpired.min.js

 

c.   On “More Options” select to include in “Before the closing body tag” and Save changes.

d. Click Save.

4. Add a Javascript widget on the same page after the previous javascript in step 3.

a.      Add Javascript widget.

b.     Select Write JavaScript option.

c.      Edit to add the function that initialize the plugin.  

$(function () {
            if ($("#scj-sessionexpired").length > 0)
                        $("#scj-sessionexpired").scSessionExpired();
});

 

d.      On “More Options” select to include in “Before the closing body tag” and Save changes.

5. Publish page template.

 

Plugin HTML data attributes 

This Section Also Contains

Bring It All Together

We bring together digital commerce, retail and call center channels with a united approach that leverages the power of onmi-channel while prioritizing JD Edwards connectivity.

CONNECT WITH AN EXPERT