I am seeing this error in my logs from the plugin hosted on Pantheon:
WordPress database error Unknown column 'secure_session_id' in 'where clause' for query SELECT * FROM wp_pantheon_sessions WHERE secure_session_id=
We are running plugin version 1.3.4 and WP 6.5.5 and PHP 8.2
Anyone seen this error? Could this be a compatibility issue as it only started happening recently after a PHP 8.2 update a month ago on Pantheon.
]]>I’m trying to create a PHP session, but oviously it’s not started. I’m curious to know, if the plugin still works with WordPress 6.6.1?
]]>Hi, I have a website which is hosted on EC2 AWS with Load Balancer ON and Sticky Session turned off but cross-zone transfer enabled. So my website is on 3 different server instances while the Database is single source of truth. So the Session Database table is shared across the different instances.
I am facing a very unusual error. When a user clicks on the button the website sends an AJAX request, which adds some data in the PHP SESSION structure. After the successful AJAX call returns the page is redirected to another page. Some times the AWS Load Balancer redirect the user to another AWS instance of the website. When the user lands on the redirected page the SESSION structure has some missing data. Which breaks the website user flow.
Why each instance has different SESSION ID even though it is part of the same user instance on the website. And why there is a missing SESSION structure when the AWS automatically switch the users between the 2 instances.
How can I fix this issue? Please advise and support regarding this matter. I will really appreciate any help.
Thank you,
]]>WordPress tells me:
An active PHP session was detected
“A PHP session was created by a call to the session_start() function. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.”
Is this plugin useful for solving or identifying my problem with the php session remaining active?
Hi,
I recently saw the notice in WP dashboard, that run below command to add index to the session tables.
terminus wp <site>.<env> — pantheon session add-index
So, i ran the command using terminal in DEV portal. After that, seen another message.
An old version of the PHP Native Sessions table is detected. When testing is complete, run terminus wp . — pantheon session primary-key-finalize to clean up old data, or run terminus wp . — pantheon session primary-key-revert if there were issues.
Then again run the primary key finalize command. Then all notices gone.
Is there any impact in the database datas? We can safely run these commands in live server also ???
]]>Hi,
I recently saw the notice in WP dashboard, that run below command to add index to the session tables.
terminus wp <site>.<env> — pantheon session add-index
So, i ran the command using terminal in DEV portal. After that, seen another message.
An old version of the PHP Native Sessions table is detected. When testing is complete, run terminus wp . — pantheon session primary-key-finalize to clean up old data, or run terminus wp . — pantheon session primary-key-revert if there were issues.
Then again run the primary key finalize command. Then all notices gone.
Is there any impact in the database datas? Can we safely run these commands in live server also ??? Is this will affect any data in database and flow?
]]>Hi,
I’m testing version 1.4.1 on Pantheon’s platform. We’re running a multisite install. The “Your PHP Native Sessions table is missing a primary key. This can cause performance issues for high-traffic sites.” upgrade message is still showing up on our subsites.
The main network site does NOT show the notice. I’m wondering if the issue might be domain related. On our dev environment, the notice doesn’t display on a subsite that uses a folder URL. But it DOES appear on a site that uses a different top-level domain.
Is there any way to hide this until the multisite upgrade tool is ready to go? If not, we can certainly roll back.
Thanks!
Eric
My site is on Pantheon and it is research.udel.edu. Everything was fine until I just updated my PHP Native Sessions to 1.4.0 and now I am getting this message:
Your PHP Native Sessions table is missing a primary key. Please run?wp pantheon session add-index
?and verify that the process completes successfully and that this message goes away to resolve this issue on your live environment.
I have tried to get support from Pantheon but they told me to delete the plugin and then delete the data table.
I was able to delete the plugin but not the data table. I am a designer and not a coder and I don’t know how to delete the data table. I would need to know the path and I can’t seem to find it. I am on a mac and I don’t know terminal. Is there a way to resolve this or roll back to a version that will work?
]]>function check_native_primary_keys() is not taking in consideration multisite ids, $table_name is always ‘wp_’ even though my expected result would include ‘wp_{site_id}_’
]]>Your PHP Native Sessions table is missing a primary key. Please run wp pantheon session add-index
and verify that the process completes successfully and that this message goes away to resolve this issue on your live environment.
I run the command in my server
wp pantheon session add-index
–path=/var/www/project
but my site CSS is broken so I reverted it:
wp pantheon session primary-key-revert –path=/var/www/project
So how to proceed with it? Rollback to old version?
]]>Im getting this error
Your PHP Native Sessions table is missing a primary key. Please run?wp pantheon session add-index
?and verify that the process completes successfully and that this message goes away to resolve this issue on your live environment.
How to solve this error. please share detailed solution where we have to run this command
wp pantheon session add-index
Hi, first I want to thank you for this great plugin. I need your help. For security reasons, I do not want the sessions to store and display the user IP. Can you give me a code fix for this?
Greetings
Daniel
]]>Hi, digging in my logs while looking for performance optimization, I found a lot of this:PHP Warning: session_start(): Failed to read session data: user (path: /var/lib/php/sessions)
After a lot of searches I found that this message could be caused from a read operation that returns null instead of empty string, so I made a workaround:
I’ve changed line 74 of wp-native-php-sessions/inc/class-session-handler.php from
return $session->get_data();
to
return $session->get_data() ?: '';
Is this correct? There is a better way to solve this problem?
]]>Hi,
since a few days ther are white pages on my homepage, especially on mey wp-admin account.
Here is the shown error:
Warning: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent in /mnt/web106/a3/72/56783072/htdocs/wp-content/plugins/wp-native-php-sessions/pantheon-sessions.php on line 170 Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /mnt/web106/a3/72/56783072/htdocs/wp-includes/option.php on line 132 Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0
Thank you for help!
]]>On PHP 8.1 this plugin has lots of depreciation notices, (See below).
People have been reporting this for nearly 6 months now on StackOverflow etc – is there a new version of the plugin on the way to address this?
Deprecated: Return type of Pantheon_Sessions\Session_Handler::open($save_path, $session_name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WebFarmFiles\wwwroot\foo.com\wp-content\plugins\wp-native-php-sessions\inc\class-session-handler.php on line 26
Deprecated: Return type of Pantheon_Sessions\Session_Handler::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WebFarmFiles\wwwroot\foo.com\wp-content\plugins\wp-native-php-sessions\inc\class-session-handler.php on line 117
Deprecated: Return type of Pantheon_Sessions\Session_Handler::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WebFarmFiles\wwwroot\foo.com\wp-content\plugins\wp-native-php-sessions\inc\class-session-handler.php on line 60
Deprecated: Return type of Pantheon_Sessions\Session_Handler::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WebFarmFiles\wwwroot\foo.com\wp-content\plugins\wp-native-php-sessions\inc\class-session-handler.php on line 37
Deprecated: Return type of Pantheon_Sessions\Session_Handler::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WebFarmFiles\wwwroot\foo.com\wp-content\plugins\wp-native-php-sessions\inc\class-session-handler.php on line 82
Deprecated: Return type of Pantheon_Sessions\Session_Handler::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\WebFarmFiles\wwwroot\foo.com\wp-content\plugins\wp-native-php-sessions\inc\class-session-handler.php on line 98
]]>
In my web application I have noticed the session data getting wiped out randomly/intermittently. When this happens there is a PHP warning msg: ‘Warning: session_start(): Failed to decode session object. Session has been destroyed in ….’.
I’m wondering this issue could be connected to this plugin. Any ideas?
I’m using latest version of WP (5.9.2) and WordPress Native PHP Sessions (1.2.4).
In my code I check session id and initiate a session if there is none:
public function start_session() {
if (!session_id()) {
session_start();
}
}
This is triggered by the init hook.
]]>Hi,
When I clic tools -> sessions I can see too many sessions with user id ‘0’ and different IP addresses. Is this supposed to be ok? There is no user with that id. What does that mean?
Best regards,
Alexander
Hi,
We have tried to run the plugin using php sessions in our website.
We figured that the code itself tested and worked successfuly only when we used PHP 7.0.
Is it possible to use sessions with PHP 7.4 or 8.0 without downgrading the php version?
Thanks.
]]>Hi,
I’m working on a multisite where each site is a different language and I’m trying to implement geolocation redirection. I only want the user to be redirected once which is why I need to be able to use session variables. The problem I’m having is that each site seems to have a separate session. So the user gets redirected to another site in the network and there’s no session variable saying the user has already been redirected.
Thanks.
]]>Hello
I noticed that the wp_pantheon_sessions table have more than 9 million rows and is using near of 2.6Gb of data.
Is there any way to automatically delete old sessions to avoid bigger table?
Is save to trunk the table?
Thanks!
]]>Errors surfacing in our PHP logs:
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE 1 = 1 AND session_id=’k16jd8b356094f670bs1hog400” at line 1 for query SELECT * FROM WHERE 1 = 1 AND session_id=’k16jd8b356094f670bs1hog400’ made by Pantheon_Sessions\Session_Handler->write, Pantheon_Sessions\Session::get_by_sid
This plugin is running off a multi-node XtraDB cluster (Galera), mysql v5.7. Engine InnoDB.
Here’s the fix that resolved the issue.
In inc/class-session.php, line ~65, (above or below) add:
$table_name = $wpdb->pantheon_sessions;
Then change this at line ~68 from:
$session_row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->pantheon_sessions} WHERE {$column_name}=%s", $sid ) );
To:
$session_row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$table_name} WHERE {$column_name}=%s", $sid ) );
I installed Native PHHP Sessions for wordpress and verified the location in wp-content and that the table was created in MySQL.
However, if I go to the sessions tool, it does not show any sessions for myself or when I attempt to utilize them. Also, the table in mySQL never populates anything.
Any help would be appreciated.
]]>This plugin creates table that doesn’t contain a primary key which is not compatible with MySQL Group Replication.
]]>Hello,
I installed your plugin due to the site health check giving me a critical warning about the active PHP session and rest API issues. After installing the plugin, the rest API and loopback warnings disappeared, but the following critical issue remains.
A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.
I’ve read some of the previous help topics about creating a mu plugin, but I don’t understand how to do this, or if it will solve my problem. Can someone please help me.
Thanks
]]>Hello,
inside of an wordpress plugin (plugin A) I start the session and write a variable:
session_start();
$_SESSION[‘LANDINGURL’] = ‘something’;
In another plugin I try on another page to read it back (form plugin using a snippet from function.php).
But there the variable is empty?
What can I do to debug this issue?
In MySQL I see that an entry was created.
Thank you very much for any hint,
Bye
Sven
Hi,
I wanted to reduce my database size, since I saw that your plugin had created a table which is now more than 1gb and using CPU and other server resources very heavily. I wanted to uninstall this plugin and check my server resources utilization. Please let me know how should I remove this plugin from my website, I mean deactivating it will remove the table (the plugin had created) or provide me the steps to completely remove the plugin without leaving behind any residual.
]]>Hello.
I have a session variable that is generated on order submission and when I echo it shows correct value… I can see it in plugin sessions list as well.
On thankyou page I call session variable $_SESSION[‘quoteno’];
but it doesn’t pass to page.
Am I missing something?
]]>Hi,
on one of my sites I get the warning:
‘ini_set(): A session is active. You cannot change the session module’s ini settings at this time’
for
‘wp-content/plugins/wp-native-php-sessions/pantheon-sessions.php:156’
I already created the file wp-content/mu-plugins/000-loader.php
I am using WordPress 5.5.1 and also the Plugin ?Ninja Firewall (4.2.5)?.
I read here, that this also happened with ?Wordfence?.
It even appears with the plugin ?WordPress Native PHP Sessions? deactivated.
When I delete the plugin I get a white screen. Out of sheer curiosity, how do I disable this plugin?
And … when I am logged in, the back end gets painfully slow.
Cheers, Carsten
]]>How do we automatically clear old sessions – sessions older than 24 hours (last active past 24 hours)?
PS: Either a Settings/Option page, or WordPress code behind, would be acceptable solutions.
]]>Hi,
Thanks for the great plugin.
I am using your plugin on a number of WP Engine hosted sites and it’s been working great for years. However, since the upgrade to WP 5.5, I notice that sessions are not stored across pages. I have debugged this and found that whereas before it played nicely with WP Engine’s caching, now it is not. Removing pages from caching where you want to use sessions does fix the issue, but this is not allowed for the home page of the site – which is a deal breaker…
Would you have any ideas on how to get it working again?
Many thanks,
Ben
]]>