Jump to content

Session forged - sessionHandler already set


benbyf
 Share

Recommended Posts

Hi! Sorry one of those perernial issues...-> moved to new hosting and some of the settings were obviously wrong as when hitting the view button while editing a page, it would link through to the page on the old hosting. I changed the host names in the config $config->httpHosts = array(...) and found I could no longer login without getting the forged notice. I cleared my cookies and deleted the contents of the sessions table in the db but no avail. 

Any advice?

Link to comment
Share on other sites

Posted (edited)

Hi,

as you moved to another ISP, maybe try to disable fingerprinting temporarily and check if that works for you. 

$config->sessionFingerprint = false;
Edited by cwsoft
Link to comment
Share on other sites

15 minutes ago, cwsoft said:

Hi,

as you moved to another ISP, maybe try to disable fingerprinting temporarily and check if that works for you. 

$config->sessionFingerprint = false;

No dice 😞

Link to comment
Share on other sites

Posted (edited)

Have you tried clearing the /site/assets/cache folder too? Or maybe even redoing the mysql excluding the caches table (edit: but include its structure--just not the data).

 

Edited by Jo J
Link to comment
Share on other sites

Sometimes it lets me in but its a blank screen, with Debug on it errors with:
 

Warning: Cannot modify header information - headers already sent by (output started at /srv/users/serverpilot/apps/mysite/public/site/config.php:1) in /srv/users/serverpilot/apps/mysite/public/wire/modules/Process/ProcessPageView.module on line 105

Warning: Cannot modify header information - headers already sent by (output started at /srv/users/serverpilot/apps/mysite/public/site/config.php:1) in /srv/users/serverpilot/apps/mysite/public/wire/core/admin.php on line 28

Warning: Cannot modify header information - headers already sent by (output started at /srv/users/serverpilot/apps/mysite/public/site/config.php:1) in /srv/users/serverpilot/apps/mysite/public/wire/modules/Process/ProcessLogin/ProcessLogin.module on line 311

Warning: Cannot modify header information - headers already sent by (output started at /srv/users/serverpilot/apps/mysite/public/site/config.php:1) in /srv/users/serverpilot/apps/mysite/public/wire/modules/Process/ProcessLogin/ProcessLogin.module on line 312

Warning: Cannot modify header information - headers already sent by (output started at /srv/users/serverpilot/apps/mysite/public/site/config.php:1) in /srv/users/serverpilot/apps/mysite/public/wire/modules/Process/ProcessLogin/ProcessLogin.module on line 313

not really sure where this data is stored or how it can be changed...?

Link to comment
Share on other sites

mmm, not sure what you mean, there's nothing weird in the config. Here's the errors i get on the front for the site with Debug turned on:

Warning: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent in /srv/users/serverpilot/apps/mysite/public/wire/core/WireSessionHandler.php on line 57

Warning: session_name(): Session name cannot be changed after headers have already been sent in /srv/users/serverpilot/apps/mysite/public/wire/core/Session.php on line 294

Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /srv/users/serverpilot/apps/mysite/public/wire/core/Session.php on line 297

Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /srv/users/serverpilot/apps/mysite/public/wire/core/Session.php on line 298

Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /srv/users/serverpilot/apps/mysite/public/wire/core/Session.php on line 299

Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /srv/users/serverpilot/apps/mysite/public/wire/core/Session.php on line 300

Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /srv/users/serverpilot/apps/mysite/public/wire/core/Session.php on line 312

Warning: Cannot modify header information - headers already sent by (output started at /srv/users/serverpilot/apps/mysite/public/site/config.php:1) in /srv/users/serverpilot/apps/mysite/public/wire/modules/Process/ProcessPageView.module on line 105

 

Link to comment
Share on other sites

I'm just guessing based on the error messages...it looks like PHP is encountering something unexpected before headers are sent.

Other things to check between old & new host:

compare php.ini (or your host's PHP config phprc);
.htaccess (or nginx.conf); 
charset headers (ensure its UTF-8)

  • Like 1
Link to comment
Share on other sites

8 hours ago, Jo J said:

You might have a whitespace (BOM) at the top of your config.php. Do you have anything to check it (like a hexdump)? 

You were totally right. I had to basically go over my config.php highlighting everything and deleting all teh whitespace and it worked, there must have been some rogue white space or strange invisible characters somewhere which VScode wasn't showing 😞 very aannoying and not something I've encountered (especially when I must have introduce the bug myself! 🤦‍♂️).

Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...