There are several reasons why it is recommended that you use your own session token / cookie:
1) Most existing web server frameworks have their own session management mechanism (cookie generation with expiration time, etc.). The general approach is to create a random string as a session identifier and map server-side user actions to the session identifier. The server then instructs the browser to set a session identifier cookie. There is no need, and sometimes it is very difficult to replace this mechanism.
2) As you already mentioned, IdToken is much more than regular session cookies.
3) Currently, the IdToken Google Identity Toolkit will expire in two weeks.
Beyond this consideration, IdToken is fairly secure as a session token. Make sure that you do not use any part of the IdToken as a session cookie, as attackers can easily create a fake file.
If your server issues its own session cookie, you must delete gtoken after the user session ends, so that the state of the login button in gitkit.js will be synchronized with your server.
source share