Java-Scripts.net
  1. Home
  2. Cookies & Storage

JavaScript Cookie Scripts

A collection of vanilla JavaScript tools for client-side storage. Learn how to set, read, and delete cookies to remember user preferences, track visits, and maintain state without a database.

Visit Counter Cookie

A simple script that counts how many times a specific user has visited your webpage. It stores the count in a browser cookie and increments it on every reload.

Last Visit Timestamp

Welcomes your visitors back by displaying the exact date and time of their last visit. Great for adding a personalized touch to member areas or homepages.

User ID Tracker

Assigns a unique, random ID to every new visitor and stores it in a cookie. Useful for basic tracking or connecting anonymous sessions without requiring a login.

Browser Info Storage

Detects the user's browser type and version, then saves this information into a cookie for easy retrieval later (e.g., for analytics or compatibility checks).

Cookie-Controlled Popup

Opens a popup window only once per user session (or set time period). It checks for a cookie before launching, ensuring you don't annoy return visitors.

Script Categories

  • Navigation
  • Date & Time
  • Forms
  • Page Effects
  • Windows & Dialogs
  • Security
  • Images & Media
  • Cookies
  • Frames

Pro Tip: All scripts are Vanilla JS and require no external libraries like jQuery.

© Java-Scripts.net
Privacy Contact