Questions tagged [session]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
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]|...
0
votes
2answers
870 views

Add session or cookie to remember last menu location

I have a site that is pretending to be three sites. This is done by a series of conditional statements and page templates to make it look like the user is on a different site depending on their menu ...
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.
1
vote
2answers
89 views

Disallow second login session

I am trying to find a solution for 2 months now but unfortunately I came up with no results. I have a subscription based website which streams music. What customers basically buy is a "panel" where ...
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?
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 ...
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 ...
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 ...
0
votes
2answers
14k views

WooCommerce: Change default country on the cart page [closed]

I'd like to change the default country on the cart page to none, i.e. to have "Select a country…" appear as the default in the drop-down list of countries. I've looked at this WooCommerce Docs ...
0
votes
1answer
77 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 ...
7
votes
1answer
608 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 ...
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 ...
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 ...
0
votes
1answer
112 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 ...
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 ...
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 ...
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
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 ...
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 ...
6
votes
2answers
703 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 ...
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 ...
0
votes
0answers
278 views

White screen after login attempt

In my wordpress site, I built a login area. In my page-login.php I ask the user to enter his login information which after click on submit will be sent to the same page - on top of the page his ...
0
votes
1answer
529 views

Session Cookie security questions

I am a .NET developer but I also administer all of our corporate websites, which are all Wordpress. I inherited the sites from someone who is no longer at my company. My company recently spent a ...
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 ...
0
votes
1answer
7k views

Get my site session in wordpress?

I am using a custom site build in zend frameword, i also have a wordpress installed in this directory, for example: www.mywordpressSite.com // here is my wordpress site.. www.mywordpressSite.com/...
0
votes
1answer
3k views

Session problem in PHP - trying to create a simple CAPTCHA

I found a CAPTCHA script online for a self-made contact form on my site. In my theme folder I have a file called captcha_code_file.php: <?php /* * * this code is based on captcha code by Simon ...
1
vote
1answer
175 views

Permalink structure with $_SESSION variables

I have a project that has content being filtered throughout the site (many custom WP_QUERY calls). Originally there was no URL needs, just filtering by $_SESSION variable. Works perfectly, but NOW ...
1
vote
1answer
774 views

How to get outside login data (session) in WordPress?

i want to use codeignider login form session in wp login form public function check_login() { if($this->session->userdata('logged_in')) { redirect('/'); } //Set ...
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 ...
0
votes
1answer
174 views

Can't redirect to previous page after using GET

I have a function that is displaying a shopping cart and products, and so after a product is added (which happens via GET) I want it to return to regular domain. This is the code that updates the ...
0
votes
0answers
164 views

SHORTINIT and sessions

Is it possible to use SHORTINIT for AJAX called php file and use a Wordpress shared $_SESSION global in it? I have this thus far: ini_set('html_errors', 0); define('SHORTINIT', true); require 'wp-...
1
vote
0answers
270 views

captcha not working in my custom plugin

I am trying to create a contact form with captcha, but captcha not working. I created captcha image by this in another file and stored value in session: //I already have start session and the ...
-1
votes
1answer
4k views

how to manage Session in Wordpress using custom login?

I am new to WordPress, i want to implement custom Login functionality using WordPress. I am using the following Code to create custom login, In wp.config file if( !session_id() ) { session_start()...
1
vote
0answers
250 views

Only allow one login session to be active at a time [duplicate]

Is there any way to restrict accounts to login only once at the same time? Ex. Mike bought a subscription from my website and also lent it to his friend John. What I want to achieve is preventing Mike ...
0
votes
1answer
71 views

Error when setting cookie

I get this error when trying to set a cookie on a WP page. Warning: Cannot modify header information - headers already sent by(...) Any help here? It worked fine when I did the php outside of ...
-1
votes
2answers
67 views

Sessions in word press [duplicate]

Is it possible to set session in wordpress. If yes can you please tell how to do it? My sample code is. <?php session_start(); if(!isset($_SESSION['impression'])) { $_SESSION['impression'] = ...
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 ...
0
votes
1answer
91 views

Using a Cron Job to dynamically populate a field ONCE, and then making the field blank the next time someone visits page

I'm probably going to butcher explaining what I'm trying to do, so bare with me. Essentially I'm working on a custom Contest type of solution for a client. I'm using Gravity Forms for the users to ...
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 ...
1
vote
1answer
251 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 ...
1
vote
1answer
467 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 ...
0
votes
1answer
174 views

Changing user_login ends current session

I have a site we wanted the login username to be the user's e-mail address. The user_login column contains the e-mail address. No problem. I created a custom function so that when the user updates ...
0
votes
1answer
191 views

User not logged first time I open the homepage

I am experiencing a weird issue and I didn't find any luck on Google. Every time I open my homepage it looks like I am not logged in (there is the form to login). But if I click on any internal link ...
2
votes
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 ...
5
votes
2answers
2k 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
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 ...
-1
votes
1answer
2k views

PHP $_session is not work in wordpress

why PHP $_session is not working in wordpress my php code is session_start(); session_register('lang_opt'); $_SESSION['lang_opt'] = $_POST['lang_opt']; $mylang = $_SESSION['lang_opt']; echo $...
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 ...