Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6946883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:37:20+00:00 2026-05-27T13:37:20+00:00

All I want to do is increment a COOKIE for each opened tab. Management

  • 0

All I want to do is increment a COOKIE for each opened tab. Management of the COOKIE variable will be in PHP, I’ve sorted that out, but I don`t really know how to test if a new window has been opened (Javascript or Jquery). Any heads up? Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:37:21+00:00Added an answer on May 27, 2026 at 1:37 pm

    you cannot tell if a new window/tab has been opened from the server side. you can guess it however, by constantly sending a signal from an already open window to the webserver (e.g., ping the server from the page via ajax every X seconds).

    edit:

    if you only want to detect that a new tab has been on the client side only, there are several things you can do:

    • user clicks on a link/button, and you open a new window/tab because of that click (e.g., via a window.open() call), then you simply increment the cookie as you would normally increment cookies in javascript, and do it at the same place as your window.open() call.
    • if the user typing a url in a new tab is also considered opening a new window (e.g., your program isn’t responsible for initiating the window…say, it was a middle/shift click on an anchor), then it gets more difficult to detect using javascript alone. One way is to add a field into local storage, and increment it when the page loads, and decrement it when the page is closed (listen for the unload event, like window.onbeforeunload). Then, to check how many windows is currently open, you can read that field. Unfortunately, this won’t work on lesser browsers like IE(6|7|8).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i found some freaky error. I want to increment a counter, but the variable
So far I can list all the students essays but I want to be
I'm using php and MySQL. I have two tables. I want to select all
I want to increment a variable and - if a particular condition is fulfilled
I have about 1000 rows, and want to increment all of the rows' ID
All I want is to be able to change the color of a bullet
All I want is to update an ListViewItem's text whithout seeing any flickering. This
All I want is a pragmatic random number generator in C# so I can
All I want is to get the website URL. Not the URL as taken
All I want is a one pixel black border around my white UILabel text.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.