Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How can we directly access cookie on client side

$
0
0

How can we directly access cookie on client side without interop ?

I tried using interop it worked well but are there no ways to access browser cookie directly.Following is the script of interop i want to mimic in wasm using dotnet libraries if possible if not please provide reference.

window.cacheHelpers = {        async addToCache(cacheName, requestUrl, responseData) {        const cache = await caches.open(cacheName);        const response = new Response(JSON.stringify(responseData), {            headers: { 'Content-Type': 'application/json' }        });        await cache.put(requestUrl, response);    },    async getFromCache(cacheName, requestUrl) {        const cache = await caches.open(cacheName);        const response = await cache.match(requestUrl);        if (response) {            const data = await response.json();            return data;        }        return null;    },    async deleteFromCache(cacheName, requestUrl) {        const cache = await caches.open(cacheName);        await cache.delete(requestUrl);    }};

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>