gboudreau / nissan-connect-php

Use the Nissan Connect (was Carwings) API using a simple PHP class.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New fix does not work when changing request source.

Raiden38 opened this issue · comments

First, let me thank you for posting a new fix on Oct 24th, I am sooo happy to be able to use my custom webpage again! The issue I am having is that when you change source, or after a delay, the script does not work anymore. In the issue page, you mention to delete the json cache from the server. When I do that, it works fine on my PC. Then I check the page on my iphone, and it does not work anymore. I go back on my pc browser (that was working) and it's not working anymore. If I delete back that json file, it works again, until I try from another source.

Do you think we could remove that file save/reading? Can it maybe delete the file after sending the request?

Forgot to mention that the error I get is the Http authentification error as before. And I cleared the cache on all devices.. I even tried to rename the Nissan storage json file in the script but it not help.

The code will already retry to login by itself, when it receives an error.
The problem was that the login request was including old cookies, and that resulted in missing cookies in the response.
I fixed it in the above commit.
But it does seem that the auth token is short-lived now. i.e. it will expire faster that the previous implementation. i.e. slower operation, now that it will need to re-login more often.