internal SessionIdentificatorSlim(string file, string sessionId)
        {
            base.RequestedFile = file;
            base.Ssid          = sessionId;

            base.PerFileVariables = SessionContainer.GetFileDictionary(file);
            this._userInfo        = SessionContainer.GetUserInfoFromSsid(Ssid);

            CurrentSession = this;
        }
Exemplo n.º 2
0
        internal HttpSessionData(HttpRequest httpPacket)
        {
            base.HttpHeadVariables = httpPacket.VariablesHttpHead;
            base.HttpPostVariables = httpPacket.VariablesHttpPost;
            base.RequestedFile     = httpPacket.RequestUrl;

            this.Cookies    = new AVLTree <string, string>();
            this.HttpPacket = httpPacket;
            this.Stream     = httpPacket.Stream;

            try
            {
                this.RemoteEndpoint = httpPacket.TcpClient?.Client?.RemoteEndPoint;
                this.LocalEndpoint  = httpPacket.TcpClient?.Client?.LocalEndPoint;
            }
            catch { }

            if (httpPacket.Cookies != null)
            {
                foreach (KeyValuePair <string, string> kvp in httpPacket.Cookies)
                {
                    this.Cookies.Add(kvp);
                }
            }

            this.RawHttpPacket = httpPacket.RawRequest;

            if (SessionContainer.SessionIdTransmissionType == SessionContainer.ESessionIdTransmissionType.Cookie)
            {
                base.Ssid = this.Cookies["ssid"];
            }
            else
            {
                Logger.LogExcept(new NotImplementedException($"The given SessionIdTransmissionType ({SessionContainer.SessionIdTransmissionType}) could not be handled in {GetType().ToString()}."));
            }

            base.PerFileVariables = SessionContainer.GetFileDictionary(httpPacket.RequestUrl);
            this._userInfo        = SessionContainer.GetUserInfoFromSsid(Ssid);

            CurrentSession = this;
        }