Session issues in Kite Publisher

viveknathani
We have been using Kite Offsite Publisher in our React-Native based app via WebView. Once an order is placed, an error comes up in a non-deterministic fashion. It says "invalid or expired connect session" (complete error below). We have the following properties enabled as well: domStorageEnabled, thirdPartyCookiesEnabled, and sharedCookiesEnabled. The email registered with our KiteConnect app is [email protected].

complete error: {"status": "error", "message" : "Invalid or expired connect session. Try re-initiating login.", "data": null, "error type": "InputException"}
  • Vivek
    Kite Publisher JS relies on iframes, but recent browser standards limit cookies within iframes, causing issues. To bypass this, post baskets directly to the basket endpoint (details: https://kite.trade/docs/connect/v3/basket/). Render a temporary webpage with this form and auto-submit on rendering.
  • viveknathani
    viveknathani edited April 2023
    Hey @Vivek. We are doing precisely this. We log in during the morning and expect our sessions to be live throughout the day. But towards the end of market hours, we get this error. This problem does not happen every time but does happen a good number of times.
  • Vivek
    Due to regulations we can't keep multiple sessions of web so if user login to Kite web during the day it will invalidate all other sessions including publisher one.
  • viveknathani
    @Vivek. Okay but that should just open the log-in page again. Why does it throw this error? And that too, in some cases, this error comes AFTER the order is placed via publisher.
  • viveknathani
    viveknathani edited April 2023
    @Vivek - following up. any possible fixes for this?
Sign In or Register to comment.