php - Cookies don't update on some android browsers -


I have developed a two-step verification login that uses cookies to check that a device is already verified Is or not: This cookie contains a unique ID and a random password that makes changes on every access to the device. To make that update, I use this php code

  setcookie ('nameofthecookie', '', time () - 600, "/"); SetuKi ('Nephutcookie', $ NQQCentent, Time (+ 2629743, "/");   

Which works perfectly on most browsers, but it is not on some Android people: In fact, using them, the cookie is not updated.

What do I

  1. make a cookie only using setcookie ('nameofthecookie', $ newcookiecontent, time () + 2629743

    and this works ;

  2. Only use of a cookie removal

    setcookie

    and it works . ( Can anyone suggest me a solution? < p>

    Your code leads to the following headers, which is sent to the client:

      set-cookie namesfrench = deleted Gone; finished = Guru, 01-Jan-1900 00:00:01 GMT; Maximum age = 0; Path = / nameofthecookie = somevalue; expiry = Saturn, 24 May 2014 22:11:13 GMT; Maximum age = 2629743; Path = / < Based on / code>  

    (page 9), it is not specified which of the browsers will choose which path if the path is the same:

    More than one cookie satisfies the above criteria, they are ordered with more specific path attributes such as cookie headers - those less or less Order in relation to other / characteristics (eg., Domain) before specific people is unspecified.

    Then the Android browser chooses the cookie API's value, and your desktop browser selects one later. States that

    Examples of the same path and name will be overwritten on one another, while taking a fresh example, preceding examples of the same path but different names will add additional mappings.

    Basically, you do not need to reset the cookie in the empty value before setting a new value. Just remove the first line of your code.

    For more information about managing cookies with PHP, see.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -