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


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 has 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 of 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.

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

 

Apply Session Expired in internal pages

Integration jQuery Plugin

Create a new Content Block

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

2. Click on Create a content block button.

3. In the new Content Block view:

a. Add a Title

b. 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”.

c. Click on the View HTML button and configure the HTML data attributes in the div mentioned in the next section.

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

Plugin HTML data attributes 

HTML Attribute

Description

data-is-external-page

If plugin is added on external page for security, it is required to be true.

Values: true/false

Default: false.

data-message-session

Message to display after session is expired.

Default: You have been logged out.

 

Implementation in Page

Add a Content block widget to the page where the session expired message will display. The recommendation is to add the content block in the page template (Design > Page Templates).

1.      Navigate to the Page template and edit the template. The recommendation is to add this in the Ecommerce Template:

2. Add a Content block widget to the page Template. The content block can be added in any section.

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

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

a.  Add Javascript widget (Scripts & Styles section) into the Head_JavaScripts_PlaceHolder section in the page template.

b. Select the link to Javascript file option:

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

On “More Options” select to include in “Before the closing body tag”

 

c. Click on Save.

5. Publish page template.

Read Next
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