Google App Engine cookie session

Is there an easy way to manage session files using GAE? I just need to authorize the user, etc.

Thank.

+3
source share
2 answers

You can use the user APIs to authenticate users, either with Google accounts or with OpenID. If you need sessions without a login, there are several libraries like gaesessions .

+3
source

Yes, this is the easiest way for me to use Python 2.7.

import Cookie
value_session = "userid (encrypted);time of login"
name_cookie = "sessioncookie"
expires = 2629743 # 1 month in seconds

D = Cookie.SimpleCookie()
D["name_cookie"] = value_session
D["name_cookie"]["path"] = "/"
D["name_cookie"]["expires"] = expires
print(D)
0
source

Source: https://habr.com/ru/post/1787375/


All Articles