Phenomenon: I encountered a bug today, I can’t get the variable openid
Reason:
Openid is obtained through wechat service and saved in session
Then use session in WebService to get the variable, but the enablesession is not set
Webmethod default enablesession = false
Solution: [webmethod ( enablesession = true )]
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = false)]
public string Binding()
{
return Session["openid"].ToString();
}
Similar Posts:
- Solving the problem of nginx reverse proxy web service soap:address location problem
- Solve undefined variable:_ The method of session
- Session_start(): Cannot start session when headers already sent in [How to Solve]
- Wechat applet decrypts encrypteddata error: pad block corrupted solution
- How to Solve JAVA Error: “error: bad operand types for binary operator ”
- Roman to Integer LeetCode Java
- [LeetCode] 291. Word Pattern II
- Solve the problem of “typeerror: ‘bool’ object is not callable” in flash and Django
- Vue renders an error before asynchronously loading data
- [Solved] Error resolving template “XXX”, template might not exist or might not be accessible by any of the