Expiration - Basic feature of Web Code Protector

Web Code Protector

Secure your HTML, JavaScript, and CSS code with advanced encryption and protection features. Perfect for developers who want to protect their web content from theft and unauthorized use.
  • Military-grade encryption for your code
  • Anti-developer tools protection
  • Digital Rights Management (DRM)
  • Password protection for your content
  • Domain locking to restrict access
  • Expiry date for temporary access
  • Disable printing
  • Virtual machine blocking
  • Prevent screenshots
Try Web Code Protector for Free!
Expiration: A Core Feature of Web Code Protector | Secure Time-Limited Content

Expiration: A Core Feature of Web Code Protector

Learn how to set time limits on your protected web content with Web Code Protector's expiration feature

Introduction

The Web Code Protector is a powerful tool designed to secure HTML, JavaScript, and CSS code with multiple layers of protection. One of its fundamental security features is the Expiration Date functionality, which allows content creators to set a time limit on their protected web content.

Why Use Expiration?

This feature ensures that sensitive or time-sensitive materials automatically become inaccessible after a specified date, preventing unauthorized access beyond the intended timeframe.

  • Protect limited-time offers
  • Control access to subscription content
  • Prevent redistribution of trial versions
  • Secure confidential documents with expiration

Understanding the Expiration Feature

Located under the Basic tab of the Web Code Protector, the Expiration Date feature provides the following controls:

Configuration Options

  • Expiry Date Selection - Set a specific date when content will expire
  • Redirect URL - Where users are sent after expiration
  • Time Verification - Online server (secure) or local time (offline)

Expiry Date Selection

Users can set a specific date after which the protected content will no longer be accessible.

  • The default date is set to tomorrow
  • Calendar picker for easy selection
  • Supports dates far in the future

Redirect URL (When Expired)

If the content has expired, users can specify a URL to redirect visitors:

  • Renewal page for subscriptions
  • "Offer expired" notification page
  • Main website homepage
  • Custom message page

Example: https://yourwebsite.com/renew-access

Time Verification Method

Two methods to verify if content has expired:

  • Online Time Server (More Secure) - Verifies against Coordinated Universal Time API
  • Local Time (Works Offline) - Uses user's system clock

Best Practice: Use both methods for maximum reliability

How Expiration Works in Web Code Protector

Technical Implementation

When the Enable Expiry checkbox is activated, these security measures are embedded:

Time Verification Logic

// Checks current date against expiry date
if (new Date().getTime() > expiryDate.getTime()) {
    alert("This content has expired.");
    window.location.href = redirectUrl;
}

The system performs this check using either:

  • Online time server (recommended)
  • Local system time (fallback)

Auto-Refresh Mechanism

To prevent users from keeping old versions open indefinitely:

// REFRESH PAGE EVERY 3 HOURS  
setInterval(function() {  
    location.reload();  
}, 10800000); // 3 hours = 10800000 milliseconds

This ensures time-based restrictions remain effective.

Practical Applications of Expiration

Limited-Time Offers & Promotions

Use Case: Display a special discount code for only 7 days.

  • Set expiry date to match promotion end
  • Redirect to "Promotion Ended" page
  • Prevents coupon sharing after expiration

Subscription-Based Content

Use Case: Weekly reports that expire after one month.

  • Generate new protected HTML each week
  • Set 30-day expiry for each file
  • Subscribers lose access if they don't renew

Secure Document Sharing

Use Case: Legal documents with case-specific expiration.

  • Protect HTML-based legal files
  • Set expiry to case closing date
  • Documents become inaccessible automatically

Best Practices for Using Expiration

Configuration Tips

  • Always Use Online Time Verification - Prevents clock manipulation
  • Set Meaningful Redirect URLs - Guide users to renewal options
  • Combine with Other Protections - Password + Expiration = Maximum security
  • Test Before Deployment - Verify with test dates

Common Pitfalls

  • Forgetting to set a redirect URL
  • Relying only on local time checks
  • Setting expiration too far in the future
  • Not testing expiration behavior

Ready to Add Expiration to Your Content?

Start protecting your time-sensitive web materials today.

Try Expiration Feature Now

Frequently Asked Questions

Can users bypass the expiration by changing their clock?

When using Online Time Verification, no - the system checks against a trusted time server. The local time check is provided as a fallback for offline use but can be bypassed by tech-savvy users.

What happens if both time checks fail?

The system will show an error: "Could not verify content expiry. Please try again later." and prevent access as a security precaution.

Can I set different expiry dates for different parts of my page?

Yes! You can protect multiple sections separately with different expiration dates by creating multiple protected code blocks.

© Web Code Protector. All rights reserved.

Comments