Framework: temporarySignedRoute expiration not working in different timezones

Created on 5 Nov 2019  路  5Comments  路  Source: laravel/framework

  • Laravel Version: 6.0
  • PHP Version: 7.2.1
  • Database Driver & Version: pgsql

Description:

I'm using the temporarySignedRoute functionality.

$url = URL::temporarySignedRoute(
    'foobar', now()->addHours(6), ['foobar' => $foo->bar]
);

This works when I'm in the same timezone as my server (the Netherlands). But when someone else requested a temporarySignedUrl in for instance the US, there is a different timezone. Then it returns me that the Signature is invalid.
In the docs I cannot find things about timezone or something you have to configure for this, so probably this is a bug?

Steps To Reproduce:

Make a _temporarySignedRoute_ and open this in a different timezone then the server is configured at.

$url = URL::temporarySignedRoute(
    'foobar', now()->addHours(6), ['foobar' => $foo->bar]
);

Most helpful comment

This doesn't make sense to me - the expiration timestamp is generated and validated using the servers time. It's not validated against the timestamp the user is visiting from.

All 5 comments

This doesn't make sense to me - the expiration timestamp is generated and validated using the servers time. It's not validated against the timestamp the user is visiting from.

Are you setting the applications timezone to the users somehow?

@netpok No, but even when I try that:

$url = URL::temporarySignedRoute(
  'foobar', now()->setTimezone(config('app.timezone'))->addHours(6), ['foobar' => $foo->bar]
);

It is not working.

The call to now() should return the same time regardless the browser timezone.

Hey there,

Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to report back and I'll gladly help you out and re-open this issue.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shopblocks picture shopblocks  路  3Comments

SachinAgarwal1337 picture SachinAgarwal1337  路  3Comments

fideloper picture fideloper  路  3Comments

Fuzzyma picture Fuzzyma  路  3Comments

YannPl picture YannPl  路  3Comments