Jump to content

session variable randomly not set in multi instance context


elabx
 Share

Recommended Posts

Hi! Just want to check if anyone has come across this:

I have this random scenario in which apparently the session variable is not set when a second instance is getting initialized:

image.png.40a7ceb53764fa0b038fa28b48ad96d5.png

This seems to occur when the modules are getting loaded by the ModulesLoader, this is the last bit of the stacktrace being the last item the point where the second instance is instantiated:

image.png.b7907ad208a2261fcc24528e4aef622e.png

It happens randomly so not sure if I might be facing a load issue on the server? That is not allowing sessions to be initialized? Although I don't see anything in the Session class code or ProcessWire class code that would stop the variable from being available. 

@kixe I saw you struggling on the Github issues with multi instance haha so I'm just tagging you try my luck if you might have any experience with something similar.

Both instances are running the same PW version and using file Session handler.

 

Link to comment
Share on other sites

9 hours ago, BitPoet said:

Did you set $config->sessionName to different values?

Had a similar issue with a local/live site where changing the session name to different names fixed the issues I had. However don‘t use special chars in the session name. Had issues with a - or . inside my session name, which caused weired issues, not easy to spot. Removing those chars and clearing session cache resolved the issues I had. Issue occured on last stable master and using PW $session API to check for logged in frontend users. 

Edited by cwsoft
Link to comment
Share on other sites

  • 1 month later...

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