Session expires after 1 use of the session

ELLORA
Hey Sujith, I have been using the API for past year and so far the access token generated in the morning works for the entire day. From yesterday, it gets expired in a single use or within 3 to 4 times of calling the API using the same token. Forced to regenerate the access token once more. Is it just for me or are there any issues on the server or could you help me know why this is happening ?
  • SRIJAN
    Are you using set_access_token method??
  • ELLORA
    Yes, as below:

    kiteConnect.setAccessToken("xxxxx");
    kiteConnect.setPublicToken("yyyy")
  • SRIJAN
    Then wait for Rakesh Sir or Sujith Sir response.
  • ELLORA
    @SRIJAN - thanks, will then wait to hear from @sujith or @rakeshr
  • rakeshr
    kiteConnect.setPublicToken("yyyy")
    Are you using publically exposed app(not restricted to your personal use)?
    If not, then you need not set a public token(it's used only for a publically exposed app).
  • ELLORA
    No - am the only user of the program and that code has been the same from the beginning. So do you want me to comment that line and try ? Will it solve the issue am facing? In the mean time I will try commenting it and run and examine the results as well.
  • ELLORA
    It is just a program with analytics for my personal use and was running without any issues.
  • vijoeyz
    @rakeshr

    I'm referring to the Python API document, and I do not find set_public_token().
  • ELLORA
    I commented that public token line. Generated a new access token for the day and the program ran thrice and then again when running the 4th time, session expired exception was thrown by the Kite Server.

    I guess the session can only be expired by the server .... why is it expiring ??
  • rakeshr
    then again when running the 4th time, session expired exception was thrown by the Kite Server
    You need to check if another instance/process is not initiating the login as well on the same client. This thread explains more about the simultaneous sessions rule.
Sign In or Register to comment.