javascript - Push Notification Custom Save Browser id in Database


hi i am newbie to php and javascript and i am working on a project of Push Notification for my website which will push a notification to the user when a news related to specific category is published on my website i am using following code and curl with the help of google documentation


  <title>Push Notification codelab</title>

  <link rel="manifest" href="manifest.json">
  <script src=""></script>


  <h1>Push Notification codelab</h1>

  <p>This page must be accessed using HTTPS or via localhost.</p>

  <script src="js/main.js"></script>

  <button id="send">Send</button>

    $("#send").click(function() {
      $.get("curl.php", function(data) {



now i am wondering how to store a user's browser id or something so that it can send a notification to specific browser for specific category news.i am really looking forward to you guys to help me out for this problem.




there is nothing so-called as browser id, but you can generate a unique and store that in the_COOKIE, best combination of creating an unique id would beMD5(USER_AGENT . SALTMIX_STR . IPADDR), this combination will generate a unique id for each browser and you can store that in cookie usingPHP eg.$_COOKIE["BROWSER_KEY"] = 'YOUR_UNIQUE_KEY'


$generateUniqueKey  = md5($_SERVER['HTTP_USER_AGENT'].$_SERVER['REMOTE_ADDR']."[email protected]#zYp04)+");
$_COOKIE["BROWSER_KEY"] = $generateUniqueKey; //Sets a key
echo $_COOKIE["BROWSER_KEY"]; //retrieves the set key

People are also looking for solutions to the problem: php - CakePHP install with Composer version 3.1.*


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.