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
- 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.
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
Read Next
This Section Also Contains
- ECommerce CMS MVC with Bootstrap 4
- Creating a New Sitefinity Custom Template
- How to Share Template in Multisite Instance
- How to Customize a Site with Resource Packages
- Theming Bootstrap
- How to Configure the Not Available Images for Configured Products
- Page Long Cache Considerations and Configuration
- Replace Not Available Images
- Mappings Module
- Personalization Integrated with JDEdwards
- How to Add New Widget Template
- How to Include Local Web Font
- How to Use External Plugins Locally
- Sitefinity Images
- Sitefinity Authentication Expiration
- Sitefinity Health Check Service Configuration and SmarterCommerce Health Checks
- Internal Plugins Configuration in Update 6
- Internal Plugins Configuration in Update 7
- How to Setup Pickup Instructions Page
- How to Setup Terms and Conditions Page
- Sitefinity Multisite Resource Override
- Content Search Configuration
- Product Assignments (Filter by Attribute)
- Google Analytics Configuration
- Configure Azure Redis Cache (ASP.Net State Server Provider)
- Task Manager Email Notifications
- Configure Google Maps
- Catalog and Product Content Metatags (SEO)
- Cookies Configuration
- Reset Password Configuration
- Recycle Bin
- Login Page Configuration
- Error Page Configuration
- Configure SmarterCommerce Menu Backend
- Sitefinity User Group
- Copy Settings and Mapping on Multisite
- New Site – Activate Modules
- Shared Products Module
- Configure Image Optimization
- Management Console Email Templates
- How to Enable Canonical URL
- EIPP Modules
- Sitefinity File Manager
- PunchOut Configuration
- Troubleshooting