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 -
make a cookie only using setcookie ('nameofthecookie', $ newcookiecontent, time () + 2629743
and this works ; -
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
Post a Comment