Sarvesh Iyer
  • Home
  • Works
  • About
  • Contact

Cookie Validator Check

Npm package

cookie-validator-check is a utility package for validating cookies to ensure they contain specific key-value pairs. It triggers validation when the document becomes visible, allowing for redirection if the condition is met.

Screenshots


Why this 🤔

I developed the "cookie-validator-check" utility package to resolve an issue that I encountered during site authentication. Specifically, when logging in on one tab of a browser, the user was not automatically logged in on other open tabs, as the cookies were not being validated across tabs. 🔍

To address this, I created a utility that validates cookies whenever the document visibility changes, ensuring that users remain logged in consistently across all tabs. 👍
By packaging this functionality as a utility and publishing it to the npm registry, I aimed to provide a reusable solution that can be integrated into various projects, enhancing user experience and authentication reliability. 🔐


Key Features

  • Automatic Cookie ValidationThe package automatically checks cookies when the document is visible, ensuring that the cookies meet specific criteria without requiring manual intervention.
  • Key-Value Pair VerificationValidates that the cookies contain the required key-value pairs, helping to maintain data integrity and ensure that essential information is always present.
  • Conditional Redirection If the validation condition is met, the package can redirect the user to a specified URL, streamlining the process of handling cookie-based actions.
  • Enhanced SecurityBy validating cookies automatically, this package helps to prevent unauthorized or corrupted data from being used within your application, adding an extra layer of security.
  • Simple IntegrationThe package is easy to integrate into existing projects, requiring minimal setup while providing significant benefits in terms of cookie management.

Technology stack

TypescriptTypescriptnpmnpm

Let's Connect

Say hello at sarvesh.iyer3@gmail.com

For more info, here's my resume

Chennai, Tamil Nadu, India
linkedIngithubmailwhatsappphone
© 2024 Sarvesh Iyer
© 2024 Sarvesh Iyer