소스 검색

#修复mvc不同程序不能同时登录问题

zxs 1 주 전
부모
커밋
d4837fd485
1개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  1. 13 1
      robot/robotics/mvc.hpp

+ 13 - 1
robot/robotics/mvc.hpp

@@ -197,10 +197,22 @@ namespace robotics {
 				}
 			};
 
+			class cookie_id {
+			public:
+				static std::string get_id() {
+					static std::string g_cookie_id;
+					if (g_cookie_id.empty()) {
+						g_cookie_id = v3::utils::uuid();
+					}
+					return g_cookie_id;
+				}
+			};
+
 			class cookie {
 			public:
 				cookie() {
-					name = "SessionId";
+					//name = "SessionId";
+					name = cookie_id::get_id();
 					value = v3::utils::base64_encode(v3::utils::uuid());
 					path = "path=/";
 					time = 30 * 60 * 1000;