trace cookie creation in browser devtools

Discussão em 'Angular' iniciado por Mahdi, Novembro 1, 2024.

  1. Mahdi

    Mahdi Guest

    I'm trying to understand a website's login process

    After I login, it creates a cookie but I can't find out which code is creating this cookie

    I used firefox devTools and I can see that after posting data to login page the next request contains that specific cookie but none of the previous request's responses have any header to create that cookie

    I searched for document.cookie in every js file, and set breakpoint on every line but none of them triggered for that cookie creation

    I injected this code in console before login, but still no luck

    origDescriptor = Object.getOwnPropertyDescriptor(Document.prototype, 'cookie');
    Object.defineProperty(document, 'cookie', {
    get() {
    return origDescriptor.get.call(this);
    },
    set(value) {
    debugger;
    return origDescriptor.set.call(this, value);
    },
    enumerable: true,
    configurable: true
    });


    The website is written with angular I guess (ng-version="17.0.8")

    Is there any other way to create cookies? I'm a web developer myself and I've always thought that it's only possible to create cookie through js and http response headers

    P.S: I was googling around and saw some posts about firebug and the ability to create breakpoint on cookie creation but it seems it's replaced by firefox dev edition and this one doesn't have that ability

    Continue reading...

Compartilhe esta Página