Articles of session

Where is the wordpress session stored?

I need to be able to validate the session integrity from an external app. I can’t find where is the session stored in wordpress? I built a restful app that will receive the session token as a header and I would like to be able to load the user associdated to that session. Is that […]

PHP session when called wp_ajax_nopriv

I’m trying to work with sessions using wordpress ajax call api, but unsuccessfully. In begining of functions.php writed: if (!session_id()) { session_start(); } When doing ajax call for example to function add_action( ‘wp_ajax_nopriv_compare_objects_request’, ‘compare_objects_request’ ); Session in ‘compare_objects_request’ function is not available. Besides, when in function ‘compare_objects_request’ putting session_start(), then every time when call is […]

Where is function to prevents non logged users access wp-admin?

Where is the function, that prevents non logged users, access restricted pages in WordPress? I’ve looked in several files, but not found. I want to modify the way WordPress authenticates to check cookies and also sessions. Someone, help me?

Show menu item only if user is logged In (not word press login)

I am working on a web app word press. I am new to word press So maybe you will feel that this question is silly, I tried everything but i don’t want to use any plugin. here is what I need to show the register/login menu item to non-logged-in users and profile/logout menu item to […]

Can we stop session reset if page reloads?

I started a session and assigned a value and based on the value other function executes but the page reloads after first session and obviously session resets and the other page where I am calling this session the required value is not fetched. So is there a way to stop session reset? Please help thanks […]

Store and Change Session variable – PHP SESSION VARIABLE

I would like to change a session variable which will change another variable in two different places. One variable determines what posts the user will see which is in my custom post archive file(archive-spark.php) and the other in my (functions.php) file which I am using in a Gravity forms hook which determines which category the […]

Get current session in WP admin

Trying to access sessions in the WP admin and access a variable from it. function tasks_admin_sessions() { if(!session_id()) { session_start(); } } add_action( ‘admin_init’, ‘tasks_admin_sessions’, 1 ); $nonce = $_session[‘wp_nonce’] $completed_url = admin_url( “post.php?post=$post_id&action=trash&_wpnonce=$nonce” ); but I get: Notice: Undefined variable: _session What am I missing in my code to get the session variables?

update_user_meta() does not work

I asked a question yesterday, but I realised that the code was not correct and it was my bad, so I refactored everything. I have a form with two fields which when user submits and takes a quiz test, gets registered and his scores saved to user meta data table. My user gets created, but […]

The session works on the local server, but not on the web server

I have a problem with a session, it works fine on the local server, but it’s not visible on the server, the project is in wordpress, do I have to set something special about wordpress? This is my code .. Thank you very much for the answer. session_start(); I made a session on this ID […]

Turning on output buffering in a wordpress plugin

My wordpress plugin uses sessions for handling various things, and on the production site I’m testing it on output buffering is not on by default so I’m getting a lot of messages such as these: Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /blah/wp-content/themes/Starkers/header.php:12) in /blah/wp-content/plugins/rsq/store.php on line […]