Questions tagged [session]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
0answers
394 views

Woocommerce cart is a non-object inside `admin_post` action

I'm writing a custom integration plugin for Woocommerce, to add a dynamic product to the cart. Right now, without the plugin, I make POST request via a form inside an external page containing the ...
1
vote
0answers
442 views

iframe does not store session/cookie when refresh parent

I have been searching around but there was no specific answer or any indication about the problem I am facing. I have a domain, parent.com, which is just a full screen container of a WordPress-...
0
votes
1answer
593 views

Custom $_SESSION expires too early

In my custom Wordpress theme I want to keep some user's data stored over time (let's say 5 days) using $_SESSION variable. At a certain point in my theme I do a very simple thing: session_start(); $...
0
votes
1answer
2k views

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', '...
0
votes
1answer
938 views

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 ...
0
votes
1answer
4k views

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(...
0
votes
1answer
552 views

Displaying “One Time” Notification in Plugins

In WordPress's backend, you can add notifications and errors using HTML that looks like this <div class="updated error"> <p><?php esc_html_e( 'A bad thing happened!', 'your-text-...
4
votes
2answers
6k views

How should you hook a session_start() when authoring a plugin?

Learning more about sessions I've gathered that a session_start() should come directly after <?php per Where exactly do I put a SESSION_START? and I wanted to play around and create a plugin that ...
1
vote
1answer
2k views

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 ...
1
vote
1answer
2k views

How to store or cache custom shopping cart data for every user's session

I'm developing a shopping cart and I don't want to use any plugins as none of them can serve my needs. So I'm heading to create my own shopping cart. My question is: How to store what the user added ...
1
vote
2answers
3k views

how to create and show sessions in word press?

I am new to word press but know all the required PHP skills. I am using a form to create session in one page and then accessing those sessions in another page. I have done this already without word ...
0
votes
1answer
621 views

sharing the same cookie session with multiple wordpress installs on the same domain?

I'm trying to use this on both wp-config.php files of each install within the same domain which is a subdomain im using for the main site. So to be clear here... the 2 wordpress installs are on a ...
1
vote
1answer
655 views

External Authentication, session_tokens not destroyed on logout

There are many questions and answers on external authentication and some code prior to WordPress 4.0 need some tweaking to get them to work. For example, adding a fourth parameter to the ...
0
votes
1answer
132 views

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 ...
1
vote
0answers
81 views

Login/Logout Session Sharing - Multiple Wordpress Installations

I am on Wordpress 4.4.2, I have multiple wordpress installations (Not Multisite) 1st Installation :- www.example.com 2nd installation :- www.example.com/blog/ I have pasted this in my Wp-Config ...
0
votes
1answer
1k views

How to create session for user which is not an admin user

Hello I am working on building a plugin which has the following functionality like stated below My problem is I am stuck at point I have created registration form for the users where users will be ...
2
votes
1answer
530 views

Share session between my site and WP blog [closed]

I am using Yii framework for a web site and WP for a blog (don't ask why, I inherited this project). Yii is responsible for users (login/logout...), and in the blog (WP), I need to know when the user ...
1
vote
1answer
78 views

Disconnect automattically after X minutes

I recently discovered that if I don't disconnect myself from WordPress, my session could last for more than a day. I wondered what could I do to set a maximum time of inactivity on the site, after ...
0
votes
1answer
24 views

Would this be achieveable?

So i am no good at sessioning and i was wondering instead of making a site around wordpress itself though SSI and customization could i take the SSI from a configured wordpress site and plug it into a ...
0
votes
0answers
2k views

Session variables lost during Ajax calls - Wordpress - Sage Starter Theme

I'm using the starter theme Sage to create a custom Wordpress Theme. I made a very simple infinite scroll system to display every posts. On that point, everything seems to work fine. Now, I have to ...
1
vote
1answer
4k views

Why does $_SESSION only work when I am logged in?

I am including a pure PHP library (nothing to do with WordPress) into a few of my page templates. This library calls PHP session_start() function and references the $_SESSION["cart"] global variable. ...
4
votes
1answer
517 views

Display message once per session to users with a specific role

I need to display a message to only users with a specific role. The message should appear either as soon as the user logs in or if they re-open their browser after having closed it when logged in to ...
1
vote
2answers
4k views

WP_Session not acting with AJAX

The concept is to put a Button in Post Content which the user will click. Two things - The ID of the post and Number of times the user clicks the Button should be displayed. Reason - With this we ...
0
votes
1answer
422 views

How to check if the user was redirected?

I need an advice on how to the following: I have registered course custom post type and created one for example Course1. Course1 has child posts - some are private (e.g Lectures) and some are not. ...
0
votes
1answer
4k views

How to make page/post password protected so you must reenter everytime you visit the page?

I added the following to the child-theme functions.php ///time out login so you must reenter it every time// add_action( 'wp', 'post_pw_sess_expire' ); function post_pw_sess_expire() { if ( ...
0
votes
1answer
1k views

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 ...
1
vote
0answers
1k views

Which is best to use $_SESSION or WP_Session? [duplicate]

I have little confusion with $_SESSION and WP_Session over their performance,which one is best to use. thanks.
6
votes
1answer
10k views

Destroy user sessions based on user ID

I want to programatically log a specific user out of our WordPress system based on their user ID much like the 'Log Out of All Sessions' button in the WordPress user editor section. How am I able to ...
2
votes
2answers
10k views

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 ...
1
vote
2answers
3k views

share login/logout sessions across two installs?

I'm having some issues sharing the user sessions across two installs. (a) site on http://stolenmx.com (b) site on http://arcade.stolenmx.com I have installed B in the same database as A and I have ...
0
votes
0answers
85 views

Session stays active until page update in dashboard

Something very strange is happening. I am using sessions on my wordpress website and for some reason, a session stays active until I update the page in the Wordpress website. I have build a template ...
0
votes
1answer
1k views

Sessions not creating correctly in custom function

I am working with an external application called The Next Generation of Genealogy Site-Building (TNG) and integrating it into WordPress. It has been an easy matter to get the data to display inside a ...
5
votes
2answers
5k views

Allow up to 5 Concurrent Login Sessions

I'm having trouble implementing a concurrent login check. The site needs to prevent more than 5 concurrent sessions for any particular user at one time. Example: User Matt can have 5 active ...
0
votes
1answer
74 views

Parsing session info between WordPress and non-WordPress

I have a Web App that resides in example.com (non-WordPress, completely independent databases, etc) and I have a WordPress website, website.example.com and example.com/website. Users will never log ...
6
votes
1answer
1k views

Extend Wordpress (4.x) session and nonce

We've got a small web application that allows users to log in (via WordPress) and remain logged in for a max 15 min session for security purposes. Because most sessions will last longer, I have a ...
9
votes
1answer
3k views

Removing username from the 'wordpress_logged_in' cookie

I am working with a client with some strict security measures. After undergoing security review, we were notified that the user name stored in the logged in cookie, e.g. wordpress_logged_in[username]|...
7
votes
1answer
603 views

Is it possible to transfer a WordPress session to a different browser via query string?

Assuming a user has an existing WordPress session, is it possible to take the 'wordpress_logged_in_[hash]' cookie, encode it in a query string, and resume the session in a different browser? The ...
0
votes
1answer
1k views

Why WordPress not logout after I have close my browser?

The default login cookie has expiry time as "session", so suppose when I close my browser, I need to login again when I visit wp-admin. But I've found that serveral time I've closed my browser (kill ...
0
votes
2answers
2k views

Can I Set Up Session in WordPress Custom Page

I am trying to set up a login system and Contact form for Fornt End Users of my Custom WP Theme. I need to create some Ajax Post method and Send the input values to server like Captcha and User Inputs ...
1
vote
2answers
1k views

Using Sessions to Filter Posts - bad thing?

I have a post type archive with filtering in a sidebar and pagination at the bottom. One of my biggest problems is that I'll always lose any $_POST filtering whenever I click pagination as the page ...
1
vote
1answer
1k views

pass-protected pages and posts not protected after enter them 1 time

i use wordpress 3.9.2 and i read a lot of article and Q about clear cookies but some of them is too old ( for wp 3.4 and wp-pass with different code) or not solve my problem i have some password ...
1
vote
1answer
1k views

How can I test the login for an expired session?

I'm developing a login plugin and need to test the login form that pops up after a session has expired. I would like to see the popup appear on my request. Any hack is fine. Ideally some little ...
0
votes
0answers
89 views

Sessions in plugin development?

I'm developing a plugin. At present I have two files. dotmailer.php and dotmailer-add.php. I'm creating a newsletter widget. My dotmailer.php plugin adds an admin menu, with options. It allows the ...
1
vote
1answer
3k views

Fatal Error relating to sessions.php

here is the error code I have Warning: Unterminated comment starting line 2079 in /home/teamspor/public_html/wp-includes/user.php on line 2079 Warning: require(/home/teamspor/public_html/wp-...
0
votes
4answers
3k views

How to limit user to login only once per session

How can I use code to limit users from sharing there ids and password and login muliple times? what i want to do is not allow the user to login multiple times at the same time.
0
votes
1answer
111 views

Wordpress Website with Login system

I am new to WordPress but have been developing in PHP (CI specially). I stumbled into problem when I have to integrate a website developed in CI with a WordPress website. This wordpress component is ...
0
votes
0answers
1k views

How to 'remember' a site member's last visited page?

I've seen this on a couple of sites - they offer a multipage tutorials to site members. When you return to the site, they have a link that takes to the last page of the tutorial you were on. How is ...
0
votes
0answers
4k views

How to dynamically change the locale?

Sorry about making this so lengthy. I just want to explain everything clearly and walk you through what I have tried so far to solve this problem. There is an English and a Spanish version of the ...
0
votes
0answers
133 views

Reading Wordpress sessions in Magento

I'm looking for a way to read a session set in Wordpress, in Magento. Reading Magento sessions in Wordpress proved to be no problem but the other way around seems nearly impossible. Here's my ...
3
votes
2answers
6k views

Set Session Time Limit for Password Protected Posts

I have made a series of posts and pages password protected on my website using the built-in Visibility setting. They all use the same password, so the user can view all of them after entering the ...