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
- is_singular() in mu-plugins not working
- How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?
- Get php var inside javascript file (making plugin)
- How to Add jQuery Infinite Scroll to My Custom Archive Page
- publish_post hook isn’t working for scheduled posts
- How can I include PHP-Code to my post?
- how to display all posts Custom fields dynamically?
- Seriously stuck with some custom meta box/plugin stuff
- explanation for activate_plugin function in wordpress core
- Get product attribute for Simple product in WooCommerce
- Creating an Exit Confirmation Popup
- Reposition Woocommerce Message
- problems with wordpress and php version 5.3.3-1
- WordPress takes too much time (100 seconds) to load – Front end and back end
- Saving changes in wp_editor
- how to change the verification url of pie register plugin of wordpress?
- wordpress plugin is not activating from widget
- finding whether request is for post, and post id
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- WpDataTables – View Image Directory
- Server configuration for WordPress – Do I need install PHP-SSH extensions for WordPress on Fedora28?
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- Display wordpress post’s in popup?
- Using color picker in plugin, does input attribute order matter?
- WordPress 4.8.1 php getting commented
- 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]
- 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
- Wierd site output [closed]
- 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?
- Using sessions or an alternative in a plugin
- Creating an array from form inputs before it is posted to the options database
- 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
- 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
- How to insert image into the Settings Page of a Plugin?
- How to force regenerate thumbnails in WordPress posts?
- Paginated Comments “reply” does not work!
- 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 add a handler for a button in plugin?
- Internationalization of Blog Posts
- Issues with Post 2 Post Plugin
- private functions in plugins
- Populate Woocommerce order notes with custom field value
- Woocommerce Product Add-ons – Auto-select first option
- Warning: Undefined variable $admin
- public custom posts not showing in my wordpress plugin
- Conclude woocommerce-shipping-totals
- adding firstname and lastname on registration
- Plugin question, How to insert a colon in a value box
- Tickera missing attendees – No attendees found