• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / WP_Session::set_expiration() – Set both the expiration time and the expiration variant.

You appear to be a bot. Output may be restricted

Description

Set both the expiration time and the expiration variant.

If the current time is below the variant, we don't update the session's expiration time. If it's greater than the variant, then we update the expiration time in the database. This prevents writing to the database on every page load for active sessions and only updates the expiration time if we're nearing when the session actually expires. By default, the expiration time is set to 30 minutes. By default, the expiration variant is set to 24 minutes. As a result, the session expiration time – at a maximum – will only be written to the database once every 24 minutes. After 30 minutes, the session will have been expired. No cookie will be sent by the browser, and the old session will be queued for deletion by the garbage collector.

Usage

WP_Session::set_expiration();

Parameters

Returns

void

Source

File name: easy-digital-downloads/includes/libraries/class-wp-session.php
Lines:

1 to 4 of 4
  protected function set_expiration() {
    $this->exp_variant = time() + (int) apply_filters( 'wp_session_expiration_variant', 24 * 60 );
    $this->expires = time() + (int) apply_filters( 'wp_session_expiration', 30 * 60 );
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 26th November 2019

Primary Sidebar

Information

Function name: WP_Session::set_expiration
Class ref: WP_Session
Plugin ref: Easy Digital Downloads
Version: 2.9.26
Sourcefile: includes/libraries/class-wp-session.php
File ref: includes/libraries/class-wp-session.php
Deprecated?: No
API Letters: E,S,W

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 5.6.2
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites