I saw this code
from flask import gwhat is g?
simple google research reveal this
The
gname stands for “global”, but that is referring to the data being global within a context. The data ongis lost after the context ends, and it is not an appropriate place to store data between requests. Use thesessionor a database to store data across requests.
it’s like request: NextRequest. You can populate that with middleware.ts, then it will be accessible by the other.