Closed kdevan closed 1 month ago
Hey, yeah, the cookies being set for a wrong domain might be the issue.
For the XDEBUG_PROFILE
cookie you can absolutely set it yourself, or even trigger the profiling via a GET/POST parameter or enable profiling for all requests (it slows down the response time a lot though). This is an Xdebug feature, not a specifically Clockwork thing - https://xdebug.org/docs/profiler#starting.
For the x-clockwork
cookie I guess we could make the domain configurable. Meanwhile you can set the cookie yourself by replicating what Clockwork does - https://github.com/itsgoingd/clockwork/blob/master/Clockwork/Support/Laravel/ClockworkSupport.php#L427-L439.
Just wanted to thank you for the tips and direction, very much appreciated. This has been on my mind to test out. When I'm back to profiling I'll update here and close the issue.
I'm having trouble getting profiling and the toolbar working. I'm pretty sure the issue is with cookies. I have everything using the latest versions, Laravel 9 with PHP 8.1.
The main point here is that there is shared session state between back-end api and client through cookies being passed back and forth.
I'm pretty sure the issue is that the
XDEBUG_PROFILE
andclockwork-profile
cookies are set with the Domain set to the full domain of the Clockwork app (in my case api.website.com). But in a set up like this where you have something like api.website.com for back-end api and then website.com for client, the cookie domain should be set to the root domain, website.com, so that cookies can be shared with all sub-domains (in this case api.website.com).I'm wondering if there's a way to control how these cookies are set or if I could set them myself? I'm definitely willing to dig in to see where and how these cookies are set but I thought I'd ask to see someone might have some useful information about this off hand.
I'm hoping that I can profile the API requests that the node.js server is making and the client side metrics and toolbar seem really useful as well. I saw that XHR might have issues but I'm not so concerned with that, just the process up until the page is rendered.