Questions tagged [session]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
10 views

Wordpress Multisite One Login For All Subsites

I have a WordPress multisite setup with 40+ sites. (latest WP Version) I'm currently attempting to allow users to login to just one subsite and be logged into all other subsites across the multisite. ...
0
votes
0answers
7 views

Easy Digital Downloads - Cart not working on AWS hosting [closed]

We have a site hosted on AWS. But, the Easy Digital Downloads cart is not working properly. Items added to cart disappears and the items are not removed as well. Also, there is no any cache plugin ...
0
votes
0answers
17 views

Restricting wordpress login sessions for a web app

I am creating a webgl unity app that sits on a wp site and uses the wp accounts to store data. It works really well, however an issue I have is that currently a user can be logged in on two machines ...
0
votes
1answer
17 views

How to change WordPress cookies to be session-only

I don't want my WP site to set any persistent cookies. Session cookies while I'm logged in are all I want to allow. I don't want to have to ask visitors for consent, so I need to be sure that none are ...
0
votes
2answers
40 views

How to implement a $_SESSION alternative in Wordpress inside a theme without a plugin?

I want to show a popup to the first time visitor of a Wordpress site. I tried to check the visit state using $_SESSION. Something like this in the footer.php: <?php if(!isset($_SESSION['pxpop'])) ...
0
votes
1answer
19 views

How to Extend login session times to a Month

How can I extend wordpress login sessions to a month so that it doesn’t automatically ask for login after 48 hours? I am basically testing some program with wordpress and around 48 hours it fails and ...
0
votes
1answer
45 views

Session is not working properly

We have a questionnaire with a product configurator and we are saving the configuration for the user with a session. Somehow the session is not working properly. For some users it's just not saving ...
0
votes
0answers
22 views

php session not going to next page in wordpress

I have a WordPress website. As the sessions are not activated by default I did the following code in my function.php: function ur_theme_start_session() { if (!session_id()) session_start(); } ...
0
votes
0answers
32 views

$_SESSION dosent't work

So when i use variable $_SESSION['wp_childs'] = $_POST['childs'] in my plugin, nothing changes in my storage session. i use session_start(); at the top of that all pages; for use $_SESSION but i can't ...
0
votes
0answers
21 views

Retrieve parameter from url

Given a certain url, custom = www.namesite.com/r=namerefferrer to initialize a $_SESSION and retrieve the value of this $_SESSION I did: I set this in functions.php: if (!session_id()) { ...
0
votes
1answer
26 views

Like and Dislike Buttons on Post with Counter - Only allow one click per post per user session

Working on a "Like" vs "Dislike" for blog post in WordPress. While all is working fine, the intention here is to make it work for guests and logged in users, but more importantly; ...
0
votes
0answers
18 views

Unable to fetch customer (guest user) address to calculate travel cost in Woocommerce

For Guest User I am adding a travel cost for a product so I am adding a filter callback as follows add_filter( 'woocommerce_distance_rate_shipping_calculated_distance', '...
0
votes
1answer
87 views

Multi-instance WordPress usingn Memcached to handle sessions requests login every time a requests is handled by a different server

I have WordPress running in Kubernetes with horizontal autoscaling, my site uses BuddyPress to provide social-networking functionality. I also have a memcached server accessed by all the deployments ...
1
vote
3answers
5k views

Site Health : An active PHP session was detected

I'm new in WordPress development and I just created my first theme. In my wp-admin, the "Site Health" tells me that a PHP session has been detected (critical error), here is the message : A ...
0
votes
0answers
25 views

Storing session variable without interfering with Varnish

I have a form (www.example.com/form) that submits to a 3rd party app to add users to a contact list. The vendor does not provide any means of using AJAX, rather they allow you to specify a URL to ...
0
votes
0answers
34 views

Add session data using add_filter()

I'm a little new to this and learning still. I have several forms that collect data from a user. This data must then be displayed in an extra field on the shipping page of Woocommerce. I use ...
0
votes
0answers
23 views

End session screen not close automatically after login

I configured the login screen and the login process for my purposes. but there is an issue I don't know how to solve. after the session ends, there is a pop-up with a login screen called "wp-auth-...
0
votes
0answers
216 views

Correct user session/cookie handling with external site connection in wordpress

I have a wordpress + woocommerce site where the user can configure a product and create a custom one. The software that handle this configuration is on another server. So i need to send some data in ...
0
votes
2answers
305 views

How do I add $_SESSION[''] to my wordpress page?

I am trying to take my existing object array then json_encode it and add it to a $_SESSION[''] so I can request it on other pages on my website. Is there a way to save my session string (or array) and ...
0
votes
1answer
390 views

keep a variable for all pages in memory from the url

I downloaded a referrer plugin and it works fine I create my custom link and everything is fine: https://testsite.com/?r=ty5x I have a conversion system that tells me how many users have come to my ...
0
votes
0answers
24 views

PHP session not staying alive. headers already sent

I'm having trouble keeping my session alive, it times out after 3 hours (our desired custom timeframe) regardless of user activity. It used to keep the session alive for the next 3 hours every time ...
0
votes
1answer
1k views

$_SESSION variable not saving on page refresh or new page

So I have a form that allows the user to select a city. Once selected, this city is then saved to a $_SESSION variable as such : $_SESSION['city_selected'] = $_POST['location_select']; This works fine ...
0
votes
0answers
17 views

Possible to have multiple user tab login sessions

In Gmail Web, there is an option to switch between attached accounts with one click and having them working independently per Browser TAB. Is it possible to archive something similar in Wordpress?
0
votes
1answer
38 views

Requiring a Visitor to Enter a Password Each Time They visit a Page

the pandemic has changed my role within my company so that I'm now doing all of our WordPress development, despite having zero training with WordPress. Feel free to include any comments about my boss'...
0
votes
0answers
17 views

Persist nonce across user sessions?

As per the WordPress Codex nonces are unique to the current user's session, so if a user logs in or out asynchronously any nonces on the page will no longer be valid. I am using a nonce to secure ...
0
votes
0answers
7 views

Store visitor preference until browser is closed (No Login)

I have a WordPress website that does not need a login. However, there is a feature in which the user can set what cloth size chart (e.g US or UK) the user will use. What should I use to store this ...
0
votes
0answers
58 views

Login issue with subdomain installs

I have two Wordpress instances, both of them have multi-site setups. The issue is: the two instances do not seem to work together in terms of login. I sometimes can't login to the second instance ...
0
votes
1answer
44 views

after logout session not destroy from server/website side

I have a wordpress site , when i logout from client side , then session is still exists while it should be destroy. yet it is exists in site. while i cleared browser session and cookies yet it exixts.
4
votes
1answer
247 views

Does using set_transient() function can lead to MySQL problems?

As a plugin author, I have to think about many things. One of my plugins uses a temporarily PHP session to save the JSON data that receives through its API in array type. Because PHP session has its ...
1
vote
0answers
28 views

Wordpress Keeps Logging Out - What Tests Can I Run to Solve This?

I keep getting logged out of wordpress randomly. Despite having set long "Remember Me" times etc. I am still being required to log back in when I re-open my browser and whilst in admin, I randomly get ...
1
vote
0answers
14 views

User Session and Stored Cookies not get removed

I am using below code to remove the user session, cookies etc, but its not working. Please help me to resolve this issues $userid = get_current_user_id(); //get current user id sleep(30); //to ...
0
votes
0answers
53 views

wordpress login loop and session problem

I have a login problem in the Wordpress Admin panel. First I have the redirect loop wp-admin to wp-login with the param reauth=1. I tried all the suggestions found in the support forums but none of ...
0
votes
0answers
57 views

Get WordPress logged in username from root domain when WP is installed in a subfolder

Here is my URL structure: http://www.example.com/homepage.php http://www.example.com/wordpress/ Wordpress is installed in a subfolder but I need to get the cookie in homepage.php to check if the ...
0
votes
1answer
825 views

$_SESSION variables work perfectly on my local machine but returns NULL on development webserver

I'm using a hook into init where I add a certain timestamp in order to include a splash screen into within my Wordpress project. Basic logics of the script is: add_action("init", "my_function", 1) ...
0
votes
0answers
31 views

Sessions with WordPress

I am implementing custom user registration system for website clients, so that they can edit their information. But I have read a lot that WordPress do not support session. For example, https://...
0
votes
1answer
38 views

Updating transient value frequently

Is it alright conceptually to update transient value frequently. I am building up a login form & every time user enters invalid credentials, store the incorrect attempts. So I am using user IP ...
1
vote
1answer
287 views

How to expire session after 2 hours and also expire when browser closed?

I want to expire session after 2 hours and also want to expire session when browser closed add_filter('auth_cookie_expiration', 'my_expiration_filter', 99, 3); function my_expiration_filter($seconds, ...
0
votes
1answer
321 views

Best hook for when a user session ends?

I'm creating a backend feature that calculated user's login sessions during the past 2 weeks. This is easy enough to do by incrementing a custom user field when the user logs in using wp_login: ...
0
votes
0answers
411 views

Why isn't working WooCommerce session inside shortcode?

Hope you're doing great! I am trying to print the WC()->session->get inside a shortcode but getting error , bellow is my code and error function set_session(){ global $woocommerce; WC()->...
0
votes
0answers
37 views

Trying to configure cron to get next value from array on each run

So I have this block of code and it is driving me crazy: if ( ! wp_next_scheduled( 'change_quote_hook_short' ) ) { wp_schedule_event( time(), 'one_minute', 'change_quote_hook_short' ); } ...
1
vote
1answer
58 views

Session Experies and Get Logged Out Within Few Minutes

I have wordpress simple blog with few plugins installed. My problem is that after logging and working for few minutes (hardly 2-5 minutes), session expires and I get logged out of the admin area. ...
2
votes
1answer
1k views

Handling nonces for actions from guests to logged-in users

Imagine the following scenario: John has an account on my website, but is currently not logged in. He clicks the "upvote" button on an article, but is redirected to the login page because only logged-...
0
votes
1answer
138 views

Pass Wordpress variable to the next page

I would like to pass a category name into the next page. I'm using Session. In functions.php I added: function session_initialize() { if ( ! session_id() ) { session_start(); } } add_action( '...
-1
votes
1answer
788 views

Create a Custom Login System in WordPress [closed]

Please I need help with this. I wrote a basic code to create a login form that will validate, retrieve data and display on my dashboard but I have the following challenges: It always displays "...
1
vote
1answer
381 views

How to store post ID's in cookie or session to display the same posts later

I run a wp_query that fetches 4 posts from db with rand() and displays them in a grid to visitors. What I need is to display the exact same posts the query fetched the first time, a second time to ...
0
votes
1answer
75 views

Re-use Nonce in Repeating Event Signup Buttons

My understanding is that wordpress nonces (not exactly a "number used once") prevent cross-origin request forgery and last 12 hours. I'm displaying a schedule of classes with a registration button ...
0
votes
2answers
5k views

Unset session variable on page reload / setup but exclude AJAX

I'm currently trying to unset a session variable in WordPress if the page get's reloaded. I've tried a lot but it's not working like I want it. This is my function: /** * Unset filter session if ...
0
votes
1answer
471 views

$_SESSION inside php function executed by AJAX

I am defining $_SESSION['session_test'] from $_POST['reason'] I get from AJAX call. Inside of this function, $_SESSION['session_test'] does get defined, and I get desired echo result. add_action('...
0
votes
1answer
693 views

Front end ajax user login session issue

I am having an issue where the ajax login form allows me to login, sort of. If I set the redirect to the homepage after login it sends me to the homepage and gives me the admin bar at the top. However ...
0
votes
1answer
22 views

Use WP user status (logged_in) to manage access to independent application

I have WP installed in the root of my website. In the same directory there’s a completely independent application. What I want to do is the following: when the user accesses the page containing the ...