I need to create csrf token inside the controller with certain expiration time.
return csrf_token();
I tried to do like this csrf_token('300')
But i am not sure whether it sets the csrf_token expiration time for 300 seconds.
Does this way, csrf_token('300')
the right way to generate csrf_token with expiration time in Laravel 4.2 ?
Would say this does not work, if you check the function:
It has no parameters. But you can implement your own csrf_token helper.
In the current implementation, the token should be renewed with a new session. Maybe you can regenerate session id to get a new csrf token.
https://laracasts.com/discuss/channels/general-discussion/session-lifetime-timeout-and-csrf-token-mismatch