Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

Critical PHP Issue: An active PHP session was detected.

Open jmhmedia opened this issue 4 years ago • 35 comments

I'm getting the following error in my Site Health settings. After deactivating ALL plugins and reactivating one by one, I found that Unyson is the culprate.

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.

jmhmedia avatar Sep 04 '20 22:09 jmhmedia

I have the exact same issue with WP 5.5.1 and Unyson 2.7.24

jeremyJJB avatar Sep 06 '20 23:09 jeremyJJB

And I have the exact same issue with WP 5.5.1 and Unyson 2.7.24 and have remove Unyson than no problem. Please give me the solution

wholthof avatar Sep 09 '20 07:09 wholthof

Can Reproduce on latest 2.7.24: 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.

franckadil avatar Sep 11 '20 14:09 franckadil

@jmhmedia , @jeremyJJB , @wholthof Hi guys, I made some pull requests, please review and suggest corrections if you can:

#4052 #4051

The best,

franckadil avatar Sep 11 '20 14:09 franckadil

Hi,

I have modify the 2 files but now I canot startup the website.

After I change to the old situation I can startup my website

Please give a good tested update from Unyson.

Met vriendelijke groeten,

Wim Holthof

Deurzerdiep 30 | 8032 NA | Zwolle ................................................................ Wim Holthof ' 06 112 39503 E-mail: mailto:[email protected] [email protected]

Van: Franck Adil Koumba [mailto:[email protected]] Verzonden: vrijdag 11 september 2020 16:42 Aan: ThemeFuse/Unyson [email protected] CC: wholthof [email protected]; Mention [email protected] Onderwerp: Re: [ThemeFuse/Unyson] Critical PHP Issue: An active PHP session was detected. (#4048)

@jmhmedia https://github.com/jmhmedia , @jeremyJJB https://github.com/jeremyJJB , @wholthof https://github.com/wholthof Hi guys, I made some pull requests, please review and suggest corrections if you can:

#4052 https://github.com/ThemeFuse/Unyson/pull/4052 #4051 https://github.com/ThemeFuse/Unyson/pull/4051

The best,

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThemeFuse/Unyson/issues/4048#issuecomment-691136246 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ5IBX7ENCDCT4TWO36Z5YDSFIZL7ANCNFSM4QZPQIOQ . https://github.com/notifications/beacon/AQ5IBXZZH2UVNMRR5KMX4L3SFIZL7A5CNFSM4QZPQIO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFEY6N5Q.gif

wholthof avatar Sep 13 '20 09:09 wholthof

Hi, I have modify the 2 files but now I canot startup the website. After I change to the old situation I can startup my website Please give a good tested update from Unyson.

wholthof avatar Sep 13 '20 09:09 wholthof

@franckadil I took a look at the code it looks like everything is closed. Full disclosure I'm not an expert in PHP or WP plugin dev. Going off what @wholthof mentioned in his previous comment, it seems that one too many sessions have been closed since the site would not load but I'm not sure. Thank you for taking the initiative on this. I've been having a lot of headaches with Unyson lately.

jeremyJJB avatar Sep 13 '20 22:09 jeremyJJB

My workarround is add in below in themes/xxxx/funtions.php if (!function_exists('_disable_fw_use_sessions')) { add_filter('fw_use_sessions','_disable_fw_use_sessions'); function _disable_fw_use_sessions(){ return false; } }

AGAIN THE URGENT REQUEST THAT UNYSON RELEASES AN UPDATE ASAP !!!!!!!

wholthof avatar Sep 15 '20 07:09 wholthof

Please can you tell me when Unyson release an update!!!

wholthof avatar Sep 22 '20 16:09 wholthof

Same here:

An active PHP session was detected. 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 talked to my web host and they've confirmed it's the Unyson plugin that's initiating the session. When they deactivated the plugin (and crashed my site) the PHP error disappeared. I tried deleting Unyson and then reinstalling on a dev site and it caused massive corruption to my site.

@wholthof workaround 👍🏻 thanks! Adding to the urgent requests for a Unyson update.

marymaru avatar Sep 25 '20 21:09 marymaru

@valeriuzdrobau @andreiglingeanu @ViorelEremia @GheorgheP @llemurya @sergiu-radu Can you Please release an update with this fix?

@franckadil sent a pull request with the fix.

Ataurr avatar Sep 27 '20 06:09 Ataurr

Hi! I'm having the same error, and now I can't access into my WP site.

luseju avatar Sep 29 '20 03:09 luseju

I fixed it adding: session_write_close(); in lines 231 and 262 in this file: wp-content/plugins/unyson/framework/includes/hooks.php

229: session_start();
230: }
231: session_write_close();
232: }

corzel avatar Oct 22 '20 15:10 corzel

WHY DOES UNYSON NOT ISSUE AN UPDATE THAT SOLVES THIS PROBLEM ??? Surely this is not always the case that everyone is looking for a solution. Unyson come up with that Update

wholthof avatar Oct 23 '20 09:10 wholthof

Is there any solution or update yet?.

"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."

CMRD77 avatar Oct 27 '20 13:10 CMRD77

Same here, is December and Unyson Still didnt fix that issue? come on guys its a security issue are you serius? So many Themes are dependent from that, please fix your issues!

apatsidis123 avatar Dec 02 '20 12:12 apatsidis123

Same here. From what I understand, Unyson plugin uses the session to store "Flash messages". See file /framework/helpers/class-fw-flash-messages.php:

Store messages in session (to not be lost between redirects) and remove them after they were shown to the user

Some useful links :

@ViorelEremia you seem to be the developer who would know the best how to rework this Flash Messages mechanism without sessions (see "Unyson not playing nice with Varnish-caching") You actually introduced the workaround to disabled sessions : "add hook to disable sessions".

I think it's time for your bosses to give you some time to think about a rework :) Have a great New Year's Eve.

Cheers

yaaax avatar Dec 31 '20 16:12 yaaax

It's February 2021 and still no fix.

EddiebNZ avatar Feb 21 '21 08:02 EddiebNZ

We are still experiencing this issue. Any activity still going on here? And if not, is there a possibility to implement a fix and make a pullrequest ourselves?

jascha030 avatar Mar 05 '21 15:03 jascha030

Hey

Onderstaande heb ik nu na aanpassing in hooks.php op aktief

in lines 231 and 262 in this file: wp-content/plugins/unyson/framework/includes/hooks.php

229: session_start();

230: }

231: session_write_close();

232: }

Maar blijft een workarround en snap niet waarop er geen update komt

Met vriendelijke groeten,

Wim Holthof

Deurzerdiep 30 | 8032 NA | Zwolle ................................................................ Wim Holthof ' 06 112 39503 E-mail: mailto:[email protected] [email protected]

Van: Jascha van Aalst [email protected] Verzonden: vrijdag 5 maart 2021 16:25 Aan: ThemeFuse/Unyson [email protected] CC: wholthof [email protected]; Mention [email protected] Onderwerp: Re: [ThemeFuse/Unyson] Critical PHP Issue: An active PHP session was detected. (#4048)

We are still experiencing this issue. Any activity still going on here? And if not, is there a possibility to implement a fix and make a pullrequest ourselves?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThemeFuse/Unyson/issues/4048#issuecomment-791488863 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ5IBX4ZHBVF3XCJW4K4EADTCDZVTANCNFSM4QZPQIOQ . https://github.com/notifications/beacon/AQ5IBX5OP2NYM5CTSJQDNJ3TCDZVTA5CNFSM4QZPQIO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF4WSSXY.gif

wholthof avatar Mar 05 '21 16:03 wholthof

This is the new (official) fix Click here https://github.com/ThemeFuse/Unyson/pull/4052/commits/da578e754381632b27289be3d92c1a3cc7f1d14f .

El vie, 5 de mar. de 2021 a la(s) 11:05, wholthof ([email protected]) escribió:

Hey

Onderstaande heb ik nu na aanpassing in hooks.php op aktief

in lines 231 and 262 in this file: wp-content/plugins/unyson/framework/includes/hooks.php

229: session_start();

230: }

231: session_write_close();

232: }

Maar blijft een workarround en snap niet waarop er geen update komt

Met vriendelijke groeten,

Wim Holthof

Deurzerdiep 30 | 8032 NA | Zwolle ................................................................ Wim Holthof ' 06 112 39503 E-mail: mailto:[email protected] [email protected]

Van: Jascha van Aalst [email protected] Verzonden: vrijdag 5 maart 2021 16:25 Aan: ThemeFuse/Unyson [email protected] CC: wholthof [email protected]; Mention [email protected] Onderwerp: Re: [ThemeFuse/Unyson] Critical PHP Issue: An active PHP session was detected. (#4048)

We are still experiencing this issue. Any activity still going on here? And if not, is there a possibility to implement a fix and make a pullrequest ourselves?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/ThemeFuse/Unyson/issues/4048#issuecomment-791488863> , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AQ5IBX4ZHBVF3XCJW4K4EADTCDZVTANCNFSM4QZPQIOQ> . < https://github.com/notifications/beacon/AQ5IBX5OP2NYM5CTSJQDNJ3TCDZVTA5CNFSM4QZPQIO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF4WSSXY.gif>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ThemeFuse/Unyson/issues/4048#issuecomment-791514837, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGUAZ4MB5GLE5A6ABSNEWXTTCD6L7ANCNFSM4QZPQIOQ .

corzel avatar Mar 05 '21 19:03 corzel

This is the new (official) fix Click here <da578e7> . El vie, 5 de mar. de 2021 a la(s) 11:05, wholthof ([email protected]) escribió:

Thank you, though I believe that has an error in it at line 260 where there is an unrequired } in the code between the Session_Start and the session_start(['read_and_close' => true,]);

session_start(); } /** This shouldn't be here /** * PHP sessions created with session_start() function may cause issues with REST API and loopback requests due to cURL error 28. * @internal */ session_start(['read_and_close' => true,]); } }

EddiebNZ avatar Mar 06 '21 05:03 EddiebNZ

Hey,

The official fix is not working for me. Can't start the website. I go back to my solution that solves the problem

Met vriendelijke groeten,

Wim Holthof

Deurzerdiep 30 | 8032 NA | Zwolle ................................................................ Wim Holthof ' 06 112 39503 E-mail: mailto:[email protected] [email protected]

Van: EddiebNZ [email protected] Verzonden: zaterdag 6 maart 2021 06:42 Aan: ThemeFuse/Unyson [email protected] CC: wholthof [email protected]; Mention [email protected] Onderwerp: Re: [ThemeFuse/Unyson] Critical PHP Issue: An active PHP session was detected. (#4048)

This is the new (official) fix Click here <da578e7 https://github.com/ThemeFuse/Unyson/pull/4052/commits/da578e754381632b27289be3d92c1a3cc7f1d14f > . El vie, 5 de mar. de 2021 a la(s) 11:05, wholthof ([email protected] mailto:[email protected] ) escribió:

Thank you, though I believe that has an error in it at line 260 where there is an unrequired } in the code

session_start(); } /** This shouldn't be here /** * PHP sessions created with session_start() function may cause issues with REST API and loopback requests due to cURL error 28. * @internal */ session_start(['read_and_close' => true,]); } }

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThemeFuse/Unyson/issues/4048#issuecomment-791878294 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ5IBXZA4FN7KP5UHLG5OJLTCG6EBANCNFSM4QZPQIOQ .

wholthof avatar Mar 06 '21 19:03 wholthof

The official fix is not working for me. Can't start the website. I go back to my solution that solves the problem

in lines 227 and 259 in this file: wp-content/plugins/unyson/framework/includes/hooks.php 229: session_start(); 230: } 231: session_write_close(); 232: }

wholthof avatar Mar 06 '21 19:03 wholthof

See my comment above, the official fix has an extra } that shouldn't be in there, if you remove that the fix works, but it doesn't stop the PHP sessions error being listed in the Site Health screen.

The official fix is not working for me. Can't start the website. I go back to my solution that solves the problem

in lines 227 and 259 in this file: wp-content/plugins/unyson/framework/includes/hooks.php 229: session_start(); 230: } 231: session_write_close(); 232: }

EddiebNZ avatar Mar 07 '21 22:03 EddiebNZ

if it is an official fix why they do not deploy an official update so we can update it as all other wordpress plugins, so we are sure that it works for everyone?

apatsidis123 avatar Mar 08 '21 12:03 apatsidis123

Daar ben ik het mee eens. Dit is toch geen offciële oplossing maar geknoei met de beste bedoeling natuurlijk

wholthof avatar Mar 08 '21 15:03 wholthof

Hey,

My workaround is no longer showing active PHP session notifications. Isn't it better to use?

Wim

Van: EddiebNZ [email protected] Verzonden: zondag 7 maart 2021 23:48 Aan: ThemeFuse/Unyson [email protected] CC: wholthof [email protected]; Mention [email protected] Onderwerp: Re: [ThemeFuse/Unyson] Critical PHP Issue: An active PHP session was detected. (#4048)

See my comment above, the official fix has an extra } that shouldn't be in there, if you remove that the fix works, but it doesn't stop the PHP sessions error being listed in the Site Health screen.

The official fix is not working for me. Can't start the website. I go back to my solution that solves the problem

in lines 227 and 259 in this file: wp-content/plugins/unyson/framework/includes/hooks.php 229: session_start(); 230: } 231: session_write_close(); 232: }

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ThemeFuse/Unyson/issues/4048#issuecomment-792368118 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ5IBX57LTIUFK6BP7KQCHDTCP7AXANCNFSM4QZPQIOQ . https://github.com/notifications/beacon/AQ5IBX4BDMDDI5NIQ3GUDALTCP7AXA5CNFSM4QZPQIO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF45JH5Q.gif

wholthof avatar Mar 08 '21 16:03 wholthof

For me indeed no longer showing the notiication but i got 50 errors on chrome's developer tool on console, so i return to the official official!!!

apatsidis123 avatar Mar 08 '21 18:03 apatsidis123

Oke, works the official fine without problems?

Can you mail my a screenshot from the official

Wim

Van: apatsidis123 @.> Verzonden: maandag 8 maart 2021 19:13 Aan: ThemeFuse/Unyson @.> CC: wholthof @.>; Comment @.> Onderwerp: Re: [ThemeFuse/Unyson] Critical PHP Issue: An active PHP session was detected. (#4048)

For me indeed no longer showing the notiication but i got 50 errors on chrome's developer tool on console, so i return to the official official!!!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ThemeFuse/Unyson/issues/4048#issuecomment-792962751 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ5IBXZQZ7D6GQLKXFSZVQTTCUHRPANCNFSM4QZPQIOQ . https://github.com/notifications/beacon/AQ5IBXZDBO4FBOPD6LPQBRDTCUHRPA5CNFSM4QZPQIO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF5B2NPY.gif

wholthof avatar Mar 10 '21 08:03 wholthof