Yes, you must use a small change for use session in WordPress.
if ( ! session_id() )
session_start();
Better you use a custom function
function my_start_session() {
@session_cache_limiter('private, must-revalidate'); //private_no_expire
@session_cache_expire(0);
@session_start();
}
*Please edit, I write from a mobile
Related Posts:
- Find out what is using PHP sessions in WordPress
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- How To Ignore a Filter On Applying Filter the Content In a Function
- post expire after x days
- Accessing post’s meta data based on user’s click of a post
- How do I “get the next 10 posts after post_id == x”?
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- External RSS feed to WordPress Portfolio
- Redirect to another page using contact form 7? [closed]
- pagination on data fetched using SQL query
- How to delete all trashed item in one-go
- Allowing users to Sign-up > Login > Post articles that need approval
- How do I add $_SESSION[”] to my wordpress page?
- Creating an admin meta box to save post as pending
- Get data from wp_posts of mysql in to variables of wordpress-php script
- WordPress Stats Plugin: Display Post Views [closed]
- WP Insert Post If user refreshes override new post
- Strange admin-ajax / CSS / $_SESSION issue
- Plugin or ways to limit number of users logging in the website,
- WordPress is redirecting me to homepage
- WordPress hide post from custom post-type on a single page
- How can I see $post object in frontend from functions.php?
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- Failed to load resource: the server responded with a status of 500 () post.php
- How to echo a PHP Code After the Content
- Displaying friend’s posts only
- Trending Tags based on post views
- Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts
- Redirect a specific User role not admins automatically to view the post that they just updated
- When unit testing a plugin, does the plugin need to be in the wp-content/plugins directory of the WordPress tests install?
- How can I prevent a plugin from updating unless it’s minimum PHP version is met?
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- Determining where fopen() is writing files when used from WordPress AJAX call [closed]
- How Restrict access to admin dashboard by specific static ip?
- How to get images from EDD post?
- How to change ID of an attachment in wp_posts and its related tables correctly?
- Add multiple attributes to product from php
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- How to initialize something in unit test before the init hook being called?
- Add category to body class
- Plugin Development sqlite or WordPress’ database
- How to review WordPress website php version compatibility?
- Download any file after submitting a form [closed]
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- woocommerce 3.2.1 not sending order notification emails
- Cron job not firing
- Add a CSS class based on categroy id to archive pages
- Outbound link autometic converted into linkdirect , and not opening
- Access WordPress data from external PHP application.
- Problem with PHP wordpress, Undefined index: in C:\xampp\htdocs\wordpress\wp-content\plugins\epoch\classes\core.php on line 190 [closed]
- Contributive page where people logged in can write
- WP Plugins – Use includes to display page content
- Recent posts per category loop?
- Finding the screen id of a page generated with add_menu_page
- WooCommerce – set session with new cart item meta when updating cart item quantity [closed]
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Control page content visibility based on URL parameter
- WooCommerce Shopping Cart Not Initially Showing Products [closed]
- Plugin not working & permalink erorr after upgrade to php 7x on Nginx
- download button for audio file in post [closed]
- Print posts category or tag as a formatted journal
- How to translate wordpress error message
- Override a Plugin Function
- All custom widgets are not showing in widget area at the same time
- Add key and value to an array in another file
- Post deleted in trash [closed]
- How to relate 3 wordpress components with each other (Create database relationships)
- problem with register_activation_hook in plugin
- Create “new pages” within the admin section of plugin
- More gentle way to hook WordPress custom url
- What snippet do I need to type to show my ACF field show up on my theme?
- How to Call Specific .PHP file on add_submenu_page selection in Plugin Development?
- How to properly replace the_content with the html in a php file?
- Is there a way to make [Table Of Content] plugin while not using revision data?
- How to Add text value in Automatically in this conditions?
- page duplication on wordpress that wont stop
- Using sessions or an alternative in a plugin
- Hide content for specific users with id
- adding dynamic/multiple slug values in ‘option_none_value’
- Problem with Date translation in WordPress
- How to assign a specific service to a specific provider based on location
- 500 Internal server error wp_handle_upload_prefilter
- Can’t access 3rd party API, code works on local server but not on wordpress
- Compare Ajax Data Results
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- Nested DIV’s across functions in PHP, do not seem to work
- Every time I use wp_get_current_user() my plugin breaks
- How to force regenerate thumbnails in WordPress posts?
- resizes images on the fly
- get_option return incorrect values
- I created a custom form in HTML/CSS and now I need it to submit … should I create custom PHP or is there a plugin I can use?
- How to use shortcode of any plugin to show it visually where i want?
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- WordPress not updating post or disable plugin instead a white page appear
- Internationalization of Blog Posts
- Issues with Post 2 Post Plugin
- private functions in plugins
- Load my plugin before cache
- wp_insert_post() get Fatal Error from Plugin
- plugin doesn’t retrieve data from database