gotgproto icon indicating copy to clipboard operation
gotgproto copied to clipboard

Can the session expiration time be set?

Open TNT-ma opened this issue 1 year ago • 1 comments

After verifying the authorization, I found that I need to revalidate the code verification permissions the next day

Can the expiration time be set in the files saved during the session? For example, the number of valid days: 30 days or 365 days, permanently valid, etc

TNT-ma avatar Apr 06 '24 06:04 TNT-ma

You can't set the auth expiration time like this, neither does telegram automatically log-out your account on per day basis like that. I suspect that you're not using persistent session storage for your program.

Check this out for implementing a persistent session store with gotgproto: https://github.com/celestix/gotgproto/blob/d9e8596338d2e2bb5d9ddcaece73d153c89f1218/examples/auth-using-string-session/gotgproto-string/main.go#L32

This will create a my_session.session file which will contain your persistent credentials.

celestix avatar Apr 06 '24 11:04 celestix