diff --git a/engine/server/application/LoginServer/src/shared/LoginServer.cpp b/engine/server/application/LoginServer/src/shared/LoginServer.cpp index afa12138..2082af76 100755 --- a/engine/server/application/LoginServer/src/shared/LoginServer.cpp +++ b/engine/server/application/LoginServer/src/shared/LoginServer.cpp @@ -1416,20 +1416,17 @@ void LoginServer::onValidateClient(StationId suid, const std::string & username, if (ConfigLoginServer::getDoConsumption() || ConfigLoginServer::getDoSessionLogin()) { - std::string const strSessionKey(sessionKey); - size_t sessSize = sizeof(strSessionKey.c_str()); - // pass the sessionkey - len = sessSize + sizeof(StationId); - memcpy(keyBufferPointer, sessionKey, sessSize); - keyBufferPointer += len; - memcpy(keyBufferPointer, &suid, sizeof(StationId)); + len = apiSessionIdWidth + sizeof(StationId); + memcpy(keyBufferPointer, sessionKey, apiSessionIdWidth); + keyBufferPointer += apiSessionIdWidth; // if LoginServer did session login, send the session key back to the client; // the client normally gets the session key from the LaunchPad, but in this mode // where the LoginServer does the session login, it will get it from the LoginServer if (ConfigLoginServer::getDoSessionLogin()) { + std::string const strSessionKey(sessionKey, apiSessionIdWidth); GenericValueTypeMessage const msg("SetSessionKey", strSessionKey); conn->send(msg, true); }