Comments (8)
Normally sessions should work out of the box now with Symfony.
What version of Symfony are you using?
Can you reproduce on a fresh Symfony install?
from roadrunner-bundle.
Using symfony 6.3 I have hard time reproducing it on production too, but it does happen as clients reported this multiple times and today that happened to me too
from roadrunner-bundle.
Are you using a custom session handler?
from roadrunner-bundle.
this is the whole framework.yaml
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework:
http_method_override: false
trusted_proxies: '127.0.0.1/8,REMOTE_ADDR,SERVER_NAME'
trusted_headers: [ 'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix' ]
secret: '%env(APP_SECRET)%'
handle_all_throwables: true
#csrf_protection: true
#http_method_override: true
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
storage_factory_id: session.storage.factory.native
handler_id: session.handler.native_file
save_path: '%kernel.project_dir%/sessions/%kernel.environment%'
cookie_secure: auto
cookie_samesite: lax
cookie_lifetime: 31536000 # one year in seconds
#esi: true
#fragments: true
php_errors:
log: true
from roadrunner-bundle.
Maybe this is also related to my problem?
from roadrunner-bundle.
I'll try to give it some time, it's strange 😬
from roadrunner-bundle.
I tried to had a look with no luck.
I tried on a fresh project, using in-memory or doctrine as user storage and everything was working fine (with one or many workers).
Are you able to provide a reproducer repository? I would gladely help as it seems pretty serious but I'm not able to reproduce it on a fresh project.
from roadrunner-bundle.
I have added the following middleware, and so far it seems fine. Since the ServicesResetter
does not register all services that can be reset (my own, internal symfony's, bundles, eg.) combining it with iterating over the private container services seems to finally work as intended.
<?php
namespace App\RoadRunner\Middleware;
use Baldinof\RoadRunnerBundle\Http\MiddlewareInterface;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Contracts\Service\ResetInterface;
readonly class ServiceReSetterMiddleware implements MiddlewareInterface
{
public function __construct(
#[Autowire("@service_container")]
private ContainerInterface $container,
#[Autowire("@services_resetter")]
private ServicesResetter $servicesResetter,
)
{
}
public function process(Request $request, HttpKernelInterface $next): \Iterator
{
yield $next->handle($request);
$this->servicesResetter->reset();
$ref = new \ReflectionClass($this->container);
$prop = $ref->getProperty("privates");
$services = $prop->getValue($this->container);
foreach ($services as $service) {
if ($service instanceof ResetInterface) {
$service->reset();
}
}
}
}
I would live to add reproducer repo, but I cant myself easily reproduce it, it was really random.
from roadrunner-bundle.
Related Issues (20)
- RPC Service in Console App HOT 1
- Symfony 6.2: Deprecation warnings HOT 2
- Problem with sessions HOT 4
- Entity manager bleeding entities over different requests HOT 5
- roadrunner-cli not in composer requirements
- Failed after run http.Plugin HOT 12
- Cookies not transferred HOT 2
- The RoadRunner plugin 'rpc' is disabled, try to add a `rpc` section to the configuration file. HOT 1
- Reset stateful services question
- GRPC PHP Fatal error: Uncaught Error: Interface "App\Grpc\Generated\Calculator\CalculatorInterface" not found CalculatorService.php
- Running multiple environments at once? HOT 3
- 3.0.1 patch version dropped support for symfony ^6.0 HOT 2
- `Undefined constant self::MASTER_REQUEST`
- Symfony integrated HttpCache reverse proxy cannot serve cached responses
- Event dispatcher doesn't reset automatically after next request HOT 1
- Is there any way to change http log output?
- SentryMiddleware incompatibility with sentry ^4.0
- phpfpm faster than roadrunner HOT 6
- Invalid alias definition: alias "Baldinof\RoadRunnerBundle\Http\RequestHandlerInterface" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roadrunner-bundle.