laravel-caffeine: Forms still expire

Expected Behavior

Forms stills alive

Actual Behavior

They expire

Details

Using the middleware method, all the drips get 204, no problem so far. The only thing I noted is that after the session time expiration, the XSRF-TOKEN cookie being sent for the drip disappears.

It seems that Laravel doesn’t want to maintain the token session alive in the form even if the drips are correctly sent and responded.

Already removed and reinstalled Caffeine and dumped the autoload juts to be sure.

Workaround

Using Axios, I made a normal get to the form located axios.get('https://myapp.test/login and the token lives throught the timeout . But using axios to the default dripping route doesn’t.

It would seem that Laravel session enforces the current URL, but after using get on other routes of the application (like axios.get('https://myapp.test/artist/michael-jackson/albums/all')) also keep them alive.

See updates.

Environment

  • PHP Version: 7.2.4
  • NGINX: 1.12.2
  • Laravel Version: 5.6
  • LaravelCaffeine Version: 0.6.8

Stack Trace

Unavailable.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (10 by maintainers)

Most upvoted comments

Update 3 (This is weird)

Installed Caffeine, everything default.

I deleted the route declaration in /routes/web.php of this package:

// Route::get($dripRoute, Drip::class.'@drip');

Then I added the default route in my web.php, at root.

Route::get('/genealabs/laravel-caffeine/drip', function() {
    return response(null, 204);
});

Success. Forms doesn’t expire.

But it won’t work if the route is declared using the web.php of this package. That means that something is interfering with the route that Caffeine is declaring, but at glance everything is clean.

But…

Moving the same code I added in my web.php to the route/web.php package gives the same problem:

// Route::get($dripRoute, Drip::class.'@drip');

Route::get('/genealabs/laravel-caffeine/drip', function() {
    return response(null, 204);
});

With this, forms still expire.