private function getCookie($name, $decrypt = false)
    {
        try {
            $cookies = $this->connection->WebSocket->request->getCookies();

            if (isset($cookies[$name])) {
                $raw = rawurldecode($cookies[$name]);

                if (!$decrypt) {
                    return $raw;
                }

                $decrypted = @Crypt::decrypt($raw);

                if ($decrypted) {
                    return $decrypted;
                }
            }

            return null;
        } catch (Exception $ex) {
            \Log::error($ex);

            return null;
        }
    }
private function getCookie($name, $decrypt = false)
    {
        try {
            $cookies = $this->connection->WebSocket->request->getCookies();

            if (isset($cookies[$name])) {
                $raw = rawurldecode($cookies[$name]);

                if (!$decrypt) {
                    return $raw;
                }

                $decrypted = @Crypt::decrypt($raw);

                if ($decrypted) {
                    return $decrypted;
                }
            }

            return null;
        } catch (Exception $ex) {
            \Log::error($ex);

            return null;
        }
    }
private function getCookie ( $ name , $ decrypt = false ) { try { $ cookies = $ this -> connection -> WebSocket -> request -> getCookies ( ) ; if ( isset ( $ cookies [ $ name ] ) ) { $ raw = rawurldecode ( $ cookies [ $ name ] ) ; if ( ! $ decrypt ) { return $ raw ; } $ decrypted = @ Crypt :: decrypt ( $ raw ) ; if ( $ decrypted ) { return $ decrypted ; } } return null ; } catch ( Exception $ ex ) { \ Log :: error ( $ ex ) ; return null ; } }
Gets a cookie by the name and if needed, can decrypt the value.

@return string|null
Gets a cookie by the name and if needed can decrypt the value .