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
- How to fix the admin menu margin-top bug in WordPress 5.5?
- Cleaning up WordPress to improve performance?
- How build a custom login/register form with error handling?
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Using FirePHP with WordPress
- Output a WooCommerce product custom field in WooCommerce using get_post_meta()
- Does wp-cron runs all tasks scheduled at same time together or one after other?
- WordPress blockquote removes “ tag
- If Meta Checkbox is checked, do something?
- Output 2 items within the Loop
- Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?
- Can I use HTTP POSTs? Is there a better alternative?
- Will simple function names in a class structure conflict with other plugins?
- How can i upload images in an admin page?
- WordPress: Access a plugin from within a theme
- Modify HTML structure of fields in woocommerce checkout form
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Update results, Before deleting the related category [closed]
- wordpress archive a user
- How to change theme programmatically from a external application?
- How to Return in WordPress Function php file?
- Hide Featured Image Meta Box on Editor Screen
- wp_redirect only works on main site and not on other sites
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- require_once() if a product in woocommerce contains a tag [closed]
- How do I get my Javascript scripts working?
- Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?
- Only show first image in foreach loop
- How to suppress template-parts in undescores?
- How run a non-WordPress PHP Program on a WordPress site?
- Issue Enqueueing WordPress style.css
- Add valid XHTML closing img tags to WordPress galleries
- Changing wordpress default language
- Contact form – problem with displaying message about sent mail
- How to Redirect Buddypress Directories To Login Page For Non Logged in Users
- Prevent Buddypress Rewrite Rules on Non-Buddypress pages/posts
- How do I set a hidden field to a value?
- Display logged in user name and lastname on page
- How to Add a cutsom slug to my custom author role
- Reading URL Parameters
- Enqueue script only on child pages of custom post types
- Attach and retrive multiple pdf files to post or page
- Link to index.php from home.php?
- How do I remove an action hook inside a class that is called by another class?
- Merging Multiple WordPress Websites
- Replace an array (with identical values) with another array in the_content
- WordPress/NGINX not respecting the category URL for new posts
- Display current user metadata on WordPress page
- PHP Error Backtrace / create_function deprecated
- Filtering markers on google map by WordPress category[SOLVED]
- scroll scrpit to particular button position to next id when click button
- What is wrong in this code?
- perform mathematical operation on shortcode
- directorypress theme error mysql_error() [closed]
- wp add inline style in loop
- Do_shortcode on PHP file outside theme ALMOST works
- ACF repeater image in video poster with jquery
- What is proper way to use the php if statement? [closed]
- How can I change the URL via add_rewrite_rule()
- How can I change the location where the custom field is displayed in the Quick Edit tab in WordPress