Questions tagged [session]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
27
votes
5answers
75k views

How to store and receive variables in WP sessions?

I have a form with some checkboxes and inputboxes selectboxes and it shows what the user wants via an ajax call. The problem is that when the user click on the item and the detail page is shown and ...
16
votes
3answers
59k views

How to use my own custom session value in Wordpress?

How can i use my own (custom) session value in Wordpress? For example: $_SESSION['myname']="4lvin" I've already inserted session_start() at all page i need as following. <?php session_start(); $...
11
votes
1answer
11k views

How reduce wordpress login session timeout time?

I want to logout user autometically when user is idle for more than 10 minutes.That mean suppose user is logged in to a site and user didn't browse any pages for more than 10 mins.when he browse any ...
9
votes
2answers
2k views

achieving login implementation without using sessions

Wordpress does not use sessions. I always wondered what mechanism does WP use to maintain a user state when user goes from page to page?
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
586 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 ...
7
votes
1answer
8k views

Preventing session timeout

Not sure if this is a bug or by design, but it's damn annoying. Every so often, more so after updating the core, while in the admin section, I get booted out with the infamous "Your session has ...
6
votes
4answers
2k views

Ban a user and end their session

I'm working on a plugin derived from this tutorial. So far, the plugin adds a checkbox on a user's profile edit page where admins can ban the user. If checked, the user will receive a message upon ...
6
votes
1answer
3k views

Disable WordPress 3.6 idle logout / login modal window / session expiration

I manage a WordPress site hosted at WPEngine that was recently force-upgraded to version 3.6. The upgrade introduced "In-line login following expired sessions", and therein lies the problem. The ...
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 ...
6
votes
1answer
532 views

WordPress and PHP Sessions - Security and Performance

I'm writing a WordPress plugin to deal with a third-party API. This API requires a session identifier be passed to it so that the API (which basically functions as a third-party cart) knows what ...
6
votes
2answers
687 views

How to pass users back and forth using session data?

I have applications that I wrote that use SAML and then a user database to define permissions for them all. And basically once a user signs on via our SSO they can use the applications with their ...
5
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 ...
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 ...
5
votes
2answers
1k views

Are transients private or public?

Are WP transients specific to the user-session or can they be accessed from any session anywhere? Since they are written to the DB, I would imagine they are public and accessible everywhere, but is ...
5
votes
1answer
3k views

Enable WordPress Sessions

I'm wondering why WordPress does not support sessions and many people out there claim that putting the following code in functions.php might not be a good idea (it in fact works for me but returns PHP ...
5
votes
2answers
6k views

Does wp_logout_url() destroy a session? (Logging out question)

I have a ridiculous issue with logging users out of my site. Basically, the client has sensitive data and when I call wp_logout_url I redirect to another url. That's fine, but the browser caches the ...
4
votes
2answers
5k 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 ...
4
votes
2answers
3k views

How to fake a Wordpress login?

As many of you know WPEngine don't support PHP SESSIONS unless the user is logged in. In that case WPEngine start taking consideration of PHP SESSIONS and the software based on hybridauth like ...
4
votes
1answer
5k views

Clearing cookie on logout and session expiration

I would like to clear the session cookie when a user logs out or when their session expires. I understand that wp_clear_auth_cookie(); clears the cookie but I am struggling to understand how to ...
4
votes
1answer
506 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 ...
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 ...
3
votes
3answers
7k views

SESSION in WordPress Plugin Development

I wondering the session was disable in wordpress. I try to find some information on using session variables in the wordpress. I tried the following method to implement session variables in the ...
2
votes
1answer
2k views

How to log out everywhere else, destroy all sessions “all other devices”?

WordPress panel service "log out everywhere else" is doing a nice job. I want to use this as a function outside the panel. Screenshoot
2
votes
2answers
9k 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 ...
2
votes
1answer
706 views

2 different post->IDs for single page load only in Firefox

I am saving the post->ID in a session array to keep a history of the accessed pages for a specific custom post type. This code was added to that specific custom post type's template, so that the ...
2
votes
2answers
1k views

Should I store my Facebook access tokens?

I've built a custom login page for a Wordpress site which uses Facebook for authentication. Is there any reason to store the Facebook access token in my WP database, or does it make more sense to use ...
2
votes
1answer
5k views

how to logout user on browser tab or window closes

How to logout a user when he closes the tab/window ? If no, it is possible to clear the session after specific time? How to do that?
2
votes
2answers
2k views

Custom query form submission pagination

There is a question very similar to mine, which can be found here. The difference with my question is: my search form is on several pages (page.php and single.php) and I don't use wp-pagenavi. I've ...
2
votes
1answer
2k views

Custom Connect to Facebook, problem logging in/logging out

I am working on a custom function for login in my users via facebook. I started by reading this nice tutorial on how to login in via Facebook: http://digitalzoomstudio.net/2013/02/09/tutorial-how-to-...
2
votes
1answer
2k views

integrating external php library into wordpress- the right way

If I were to load a custom library into wordpress, what would be the best place to add it? Since there are a bunch of global vars defined at the top of the library, I would not want that to be done ...
2
votes
1answer
337 views

Find out what is using PHP sessions in WordPress

Is there a way to find out what is using PHP sessions or spawning PHP processes? My Wordpress site gets heavy traffic (3.5 million hits per month). We discovered recently that we had permissions set ...
2
votes
1answer
92 views

Random popup image per user with no repeat

I am pulling images from an ACF gallery that resides on another page. What I intend to do with this is to have these images displaying full screen on my home page on a popup every time the page loads. ...
2
votes
0answers
377 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 ...
2
votes
1answer
494 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
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. ...
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 ...
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 ...
1
vote
1answer
3k views

How does Wordpress handle sessions?

I know that Wordpress is stateless and doesn't use any global session variables, but when a user logs in via Wordpress, it must somehow keep track of who is logged in, right? Does Wordpress keep track ...
1
vote
2answers
1k views

How can I get logged in user's session data from admin-ajax?

I have hooked an ajax call for a logged-in user, and now I need to catch his data inside the receiving call (the code that receives the action call). How can I get the user's ID reliably? This code is ...
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 ...
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
465 views

Trigger a function immeditely after a user posted a comment

I want to trigger a function immidiately after a user posted a comment on a post. I want to read from session data, find the user ID and look his facebook_id if he/she has any. Then i will post the ...
1
vote
1answer
1k views

How do I extend auto logout on idle OR redirect inline popup

Since the upgrade of WP to v.3.6 I've started getting regularly logged out. This is NOT after a couple of days (without 'REMEMBER ME' checked) or a couple of weeks, and NOT when I've closed the ...
1
vote
1answer
10k views

How to get login data (session) outside WordPress?

I guess WP uses a PHP session (or a cookie) to save login data, right? I have a website, which uses WP as a CMS, but display (and create) content from outside. I allow anonymous posts, by simply not ...
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 ...
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
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-...
1
vote
1answer
1k views

Pagination with $_POST and $_SESSION

I have a page on my site where in the left column is a set of checkboxes representing taxonomies and in the right column is a list of posts that fall into the selected taxonomies. The user is able to ...
1
vote
1answer
248 views

Wordpress as webapp login session

Using iOS specific metatags I enabled webapp mode on a WP site. It works nice, but I'm facing a problem: Switching between apps breaks the WP session. The webapp loads the splash image again and ...