Brief Summary When I click a link from gmail, the cookies and sessions are lost. But if I copy the link in gmail and paste it in a blank tab, the cookies are retained! Long Detail At www.mydomain.com, i set cookies and PHP session with following options: $myCookieSessionOptions = array( ‘lifetime’ => (time() + 60*60*24*363), ‘path’ => “/”, ‘domain’ =>
Deleted all cookies on wordpress.com now I am getting logged out
I wanted to delete all cookies on my wordpress.com website so that one of my popups should continue appearing. This is the code that I wrote in my function.php file: After I saved this I kept on getting logged out of WordPress because I had deleted all my cookies. I tried removing it from functions.php and saving the file but
Does php send a cookie to localhost with HTTP when session_start() with cookie_secure equal to true?
If I start a session like below for a server and a localhost client try to request the server via HTTP, does it response with the session cookie? or must it go through HTTPS? I read the doc and it did say only through HTTPS, but I wonder if localhost is an exception. Answer Yes, it does: If you try
Cookie values not being returned in Firefox
This works totally fine on my local dev version in all browsers… …and will return all the current cookie values on the page, like this: The problem is that it doesn’t return anything in Firefox or Edge on production. It does work in Chrome on production though. Here’s how Chrome dev tools sees the cookies on my local version: …and
How to send the PHP value back to the HTML form?
I’ve been trying to build a program using PHP cookies. The user interface basically looks like this. My basic program The logic is this. When the user enters the product name, price and quantity and clicks on the “Add” button, the total value which is price*quantity will fall on the “Total bill value” textbox. The user can go on adding
Why cookies are added rather than changed?
I am developing a site where each user should have their own id. When I went into the console, I saw that the id was duplicated instead of being one. Is this normal and should it be? Answer Cookies, by default, use the path of the page that they are set for. You should explicitly set the path to /
Setting Security Headers and Cookie Attributes for web server in Apache or PHP?
I know there are ways to set Security Headers and Cookie Attributes in PHP, but also in the Apache Virtualhost Config, for example: or: But I could also do this in PHP instead, for each cookie / header in every php file. Is there a reason to prefer one of the options above another? Doing it in Apache seems to
Invalid character in cookie name beyond what is listed in the error message
I am getting the error: Cookie names cannot contain any of the following ‘=,; trn1314’; However, I have php code to replaced these characters before calling setcookie: It seems that setcookie chokes on other characters as well. When I test the contents of $name using the code below, I get the following Output: Can you help me add to my
How to save data into cookie in PHP from PDO
I need some help as have been stuck here for a while, please bear with me as am a rookie and perhaps this might be simple to a seasoned developer, basically am trying to save data into a cookie so that i only hit the database once, after that, I want when i reload the page to get my data
DNI show div based on landing page, continue showing div entire session
I have about 60 landing pages that use different phone numbers on them. I am using a combination of WordPress and Advanced Custom Fields to place the phone numbers on their respective pages. I am being asked to show a <div> based on the landing page URL that will not only show the phone number assigned to that page, but,