WordPress doesn’t use PHP sessions.
If you tried stating a session in your custom-written code, it’s not going to work as you’d hope.
There’s a plugin which will enable all normal session
use: https://wordpress.org/plugins/wp-native-php-sessions/
But, depending on what exactly you’re trying to achieve, you may prefer to keep things clean/do it the WordPress way and use a cookie
and store data in the database as user_meta
.
Related Posts:
- Display message once per session to users with a specific role
- How to log out everywhere else, destroy all sessions “all other devices”?
- Why does $_SESSION only work when I am logged in?
- how to create and show sessions in word press?
- Should I store my Facebook access tokens?
- Site Health : An active PHP session was detected
- integrating external php library into wordpress- the right way
- How to expire session after 2 hours and also expire when browser closed?
- Fatal Error relating to sessions.php
- How to limit the number of forgot password reset attempts in WordPress?
- How to store post ID’s in cookie or session to display the same posts later
- iframe does not store session/cookie when refresh parent
- Unique session WordPress
- Get my site session in wordpress?
- Having Issue on Redirecting With Session in WordPress
- Unset session variable on page reload / setup but exclude AJAX
- Redirecting to a custom forgot password page
- $_SESSION variable not saving on page refresh or new page
- $_SESSION variables work perfectly on my local machine but returns NULL on development webserver
- The session works on the local server, but not on the web server
- Custom $_SESSION expires too early
- Store and Change Session variable – PHP SESSION VARIABLE
- Deleting expired session tokens in WordPress
- PHP: $_SESSION destroyed after page reload for my custom session
- Set cookie parameters on wp site – PHP not working?
- Are there any drawbacks on opening a session_start in functions.php and header.php?
- Like and Dislike Buttons on Post with Counter – Only allow one click per post per user session
- PHP session not staying alive. headers already sent
- Sessions with WordPress
- Use WP user status (logged_in) to manage access to independent application
- ajax polling with admin-ajax.php
- PHP Session Variable to WordPress Error
- Allow user to select location and then set cookie for location in WordPress
- How to ‘remember’ a site member’s last visited page?
- White screen after login attempt
- Where are Sessions are being started? [closed]
- WordPress & PHP sessions
- How to transfer session after being redirected to other page
- Suddenly sessions and header location not working
- PHP – Having $_SESSION as an array and adding $_SESSION to array
- Referencing Images in javascript to display on wordpress page
- Most commented posts by time period (last 12h, last 24h and etc)
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- Divi change project category slug
- Add meta tags to a custom header
- Ajax filter button display all posts
- Check If Post Was Published More Than 6 Months Ago Using get_the_date
- Where are the src and srcset sizes coming from?
- What is the right way to add PHP code to a certain part of a page
- wp_remote_post empty $_POST
- register_setting & add_settings_error validation issues with multiple fields
- PHP code for displaying WordPress posts in a static page not working
- How to add PHP code in functions.php wordpress
- WordPress hit memory limit but not from the server
- How can I spin up a new website for a registered user automatically?
- How to override url params with rewrite rules vars?
- WordPress wp-admin redirect and exception
- Can I make get_users() query global?
- Using Argument from Function to Re-Direct Visitor (WordPress)
- Use $wpdb or other PHP script method to find/replace in WP database
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- preg_replace regex problem
- Compare $_POST returned values with term array
- Remove item in Checkout
- email alert for product availability
- How to Update post_modified of all wordpress post
- How to Change CSS Colors from Custom Plugin Settings Page
- malware undetectable by multiple scans
- how to serialize() mysql update data
- Simple WordPress endpoint route doesn’t work
- Correct PHP to output a single result of a Function with SQL Query
- How to relocate paypal button gateway on checkout page in woocommerce
- How to create a field in customize and show that in header.php?
- WordPress shortcode returns the data before
- Passing the name of selected color from the custom component to `render_callback`
- I am receiving a pluggable.php warning sign on my only http:// page
- How to remove the h6 tag for the entry-category Class
- your php installation be missing the MySQL extension WordPress CPANEL [closed]
- Can’t add script immediately after the opening tag on login page?
- Find Site ID From WP_Post
- Is it possible to create new user from external form using REST API?
- WP_Query: getting posts where custom field exists
- Foreach loop inside an array_merge
- How do I add $_SESSION[”] to my wordpress page?
- page-slug.php not working but only for specific slug
- {$key} or $key?
- How to show meta value code HTML after x paragraph
- Redirect to a page for only logged in user
- Send a mail to specific address in a custom field when a new comment is made on a specific post
- Display the 3 latest WordPress Posts on a Static Page Outside WordPress
- Export Form Data to a CSV then send it as an attachment – contact form 7
- Override user-edit.php to design own profile page
- Live to Local on MAMP, not working, outputting functions.php code
- Remove extract from function
- Undefined offset: 3 in custom function
- List all blogs, but exclude the main site
- How to append to an array and return the results in a filter?
- How to specify the path for require_once in a child theme?
- Set site title & tagline with wp.config or function.php