I have a class and in that class I have a function that performs authentication and returns a token.
I would like to store that token in memory for use by other functions in that same class.
How would I do so ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Presuming a structure like this:
if
callAuthProcedurereturns the token, simply adjust it to do this:Later, other methods on the instance of the class can use
self.tokenas necessary.