A
A
Aski_io2015-04-04 13:17:27
API
Aski_io, 2015-04-04 13:17:27

Why does Laravel 4 generate a new token on every request?

I am writing an android mobile application in AngularJS. To receive data in the application, I wrote an API on Laravel 4.
The essence of the problem is that when I test on a local server and try to send requests to the server where the API is located, I get a normal token, in fact it is not updated with each request. On some smartphones, tablets, everything works perfectly. But I took an ASUS Nexus 7 tablet from a friend, so with every request to the server, a new token is issued. When I send an authorization request with data, it creates a session and issues data, but on the next request, it gives an error that the user is not authorized and shows a new token. What could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2015-04-04
@xmoonlight

Well in the session 100%.
Are you using SSL?

A
Alexey, 2015-04-04
@xelam

The session is not saved and the token is regenerated.
Try adding this Session::regenerateToken();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question