Telegram-Mini-Apps / telegram-apps

Made from scratch TypeScript packages, examples and documentation you will surely need to start developing on Telegram Mini Apps.
https://docs.telegram-mini-apps.com/
MIT License
693 stars 192 forks source link

[Question] How to maintain user session in telegram mini apps? #471

Closed yalamber closed 1 month ago

yalamber commented 2 months ago

Hello, I am trying to set session once users load the mini apps so that future api request can use that session. I tried to use session cookie but it seems like cookies are dropped in the requests and I cannot set session cookies for the app. Do I need to always validate initData for each api reqeust to maintain the session?

heyqbnk commented 1 month ago

Do I need to always validate initData for each api reqeust to maintain the session?

Yes, you do. Here is more information about it