الشبكة/HTTP
Cookie Parser
تحليل ترويسة Set-Cookie أو سلسلة Cookie/document.cookie إلى الاسم والقيمة والسمات، والتحقق من الأخطاء الأمنية الشائعة.
A Set-Cookie header or a document.cookie string looks like one solid piece of text at first glance, but it's actually made of a name, a value, and several security attributes (Secure, HttpOnly, SameSite, and more). This tool breaks the string down into its parts and flags common configuration issues.
How to use it
- Paste a Set-Cookie header from a server response, or a document.cookie string from the browser console.
- The tool lists the name, value, and every attribute (Path, Domain, Expires, Max-Age, Secure, HttpOnly, SameSite) separately.
- Common mistakes — missing Secure on an HTTPS site, SameSite=None without Secure, and so on — are flagged with a warning.
Common uses
- Debugging why a cookie isn't being set or isn't sent on later requests.
- Checking a session cookie's security configuration before shipping (is HttpOnly, Secure, SameSite actually set).
- Reading a complex document.cookie string with multiple values while debugging the frontend.
Things to keep in mind
An HttpOnly cookie is invisible to document.cookie in JavaScript — that's a deliberate XSS defense, and analyzing such a cookie needs the actual Set-Cookie header from a network request instead.
SameSite=None requires the Secure attribute — modern browsers reject such a cookie without it.
مقالة عن هذه الأداة: ملفات تعريف الارتباط: كيف يحفظ نص صغير حالة الجلسة
الأسئلة الشائعة
ماذا تتحكم سمات Secure وHttpOnly وSameSite فعليًا؟
تقيّد Secure ملف تعريف الارتباط باتصالات HTTPS فقط، وتمنع HttpOnly الوصول من JavaScript (مما يساعد في منع سرقته عبر XSS)، بينما تتحكم SameSite فيما إذا كان يُرسَل مع الطلبات عبر المواقع.
لماذا تحتوي سلسلة ملفات تعريف الارتباط أحيانًا على عدة ملفات مفصولة بفواصل منقوطة؟
يمكن أن تحمل ترويسة الطلب Cookie عدة أزواج name=value من نفس النطاق في سلسلة واحدة، بينما تضبط ترويسة الاستجابة Set-Cookie ملف تعريف ارتباط واحد لكل نسخة ترويسة، ولكل منها سماته الخاصة.
هل تُرسَل بيانات ملف تعريف الارتباط إلى أي مكان عند تحليلها هنا؟
لا. يتم التحليل بالكامل في متصفحك — لا شيء يُرفَع إلى خادم.
ماذا تعني سمة Partitioned؟
تتيح لموقع مضمّن داخل iframe امتلاك ملف تعريف ارتباط مختلف لكل موقع أب يستضيفه، بدلًا من ملف واحد مشترك — جزء من مبادرة CHIPS التي تتيح وظائف مضمّنة شرعية دون السماح بالتتبع بين المواقع.
كم عدد ملفات تعريف الارتباط التي يمكن تخزينها لكل نطاق؟
تحد المتصفحات عادةً بين 50 و180 ملف تعريف ارتباط تقريبًا لكل نطاق، ونحو 4 كيلوبايت لكل ملف، مع اختلاف الحد الدقيق حسب المتصفح.