setcookie

Cookie domain with 302 redirect

回眸只為那壹抹淺笑 提交于 2019-12-24 09:18:46
问题 Let's say I have two servers: a) http://server-a.com b) http://server-b.com Server a has the following endpoints: 1) method: GET path: / 2) method: GET path: /do-something When a http get request is made to endpoint 1 , it responds with a header value: Set-Cookie: cookie:0834u50lksdjfbuttonmashlkjdsf; Path=/; Domain=.server-a.com; HTTPOnly When a request is made to endpoint 2 , it responds with a 302 redirect to server b . If a request is made to endpoint 1 and then directly after that

Failing to set cookies in PHP

做~自己de王妃 提交于 2019-12-24 08:16:11
问题 I have written a PHP script which takes information about visitors IP and browser from a website and stores it in a table in my database. This script is included in the header and runs every time each page is loaded, google analytics type thing. survey.php I want this code to run only for each new visitor of the website, so that I only log each new visitor. I guess this is done by setting a cookie so I wrote this other code to set a cookie and then include the survey.php only when there is no

Facebook popup remember when user likes

最后都变了- 提交于 2019-12-23 06:21:09
问题 I've implemented a code on my page that displays a facebook like popup. I've inserted this code in my website <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js'></script> <script src="https://gj37765.googlecode.com/svn/trunk/html/[www.gj37765.blogspot.com]jquery.colorbox-min.js"></script> <link rel="stylesheet" href="https://gj37765.googlecode.com/svn/trunk/html/%5Bwww.gj37765.blogspot.com%5Dfbpopup.css" type="text/css" /> <script type="text/javascript"> </script>

Simple PHP Cookie

喜你入骨 提交于 2019-12-22 12:32:23
问题 I am experimenting with cookies and i am doing this quick example, <html> <head> <meta charset="UTF-8"> <title>Cookies</title> </head> <body> <!-- Start of FORM --> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"> Username: <input type="text" name="username"><br> <input type="submit" name="submit" value="Submit"> </form> <!-- End of FORM --> <hr> <?php if (isset($_POST['username'] )) { setcookie('username', $_POST['username'], time() + 1000, '/'); if(isset($

AWS API Gateway : Use 302 redirect and set-cookie header

岁酱吖の 提交于 2019-12-22 08:35:30
问题 I used AWS API Gateway to redirect in response. simple flow : aaa.com ====> API Gateway & Lambda ==[302 redirect]==> bbb.com It worked well when following the blog. However, I couldn't set cookie at bbb.com . I followed the blog and defined another “Set-Cookie” header. My Lambda code snippet listed below. context.succeed({ location : "http://192.168.173.193:3030", setCookie: "path=/;sessionID=1234;domain=null;" }); 回答1: Did you update your Response Parameters? In that blog post notice the

Safari 11 X-XSRF-TOKEN not updated after refresh

我是研究僧i 提交于 2019-12-21 04:41:05
问题 Recently Safari 11 was released on Mac OSX. This update causes problem with our webapplication in combination with XSRF on the header of our reuest. I will try to describe the problem in a logic way. This is how a good situation would look like: When a user wants to log in, he receives a response from the server with a Set-Cookie that contains the value of the XSRF token. Eg: Set-Cookie: XSRF-TOKEN=LKNBX4DZhL708KjXNkgXnlxTDCNuhsZG1kTc2SFy498; Path=/; Secure The page refreshes The next call

Why does PHP replace pluses with spaces in $_COOKIE?

≡放荡痞女 提交于 2019-12-20 10:27:15
问题 So from my understanding of PHP and cookies, if I use the setcookie() function, then I get a cookie that is automatically url encoded. And when I go to the $_COOKIE array, I should get the cookie back, automatically url decoded. Problem is, it seems to be decoding the cookie twice when I look in $_COOKIE . Say I have a cookie whose value is "Name|ID|Email", for example: Joe|123|my+email@somewhere.com This would be encoded as: Joe%7C123%7Cmy%2Bemail%40somewhere.com Notice the plus sign is

how to set this cookie to never expire [closed]

社会主义新天地 提交于 2019-12-19 05:06:24
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have a function to create a cookie passing in the name, value and expiration (in days) of the cookie. Here is the function: function setCookie(c_name,value,exdays) { var exdate=new Date(); exdate.setDate(exdate

Android Volley, duplicate Set-Cookie is overridden

馋奶兔 提交于 2019-12-18 10:52:59
问题 Trying to use Volley lib as a network wrapper for my android application. I have a connection up and running, but the problem is that every time there is multiple "Set-Cookie" headers in the response Volley uses Map that cannot have duplicate keys, and will only store the last Set-cookie header and overwrite the rest. Is there a workaround for this issue? Is there another lib to use? 回答1: I tried overiding classes to fix this but when I had to edit NetworkResponse, I was descending too far

update cookie value in php

烂漫一生 提交于 2019-12-18 09:35:59
问题 I am converting the array into cookie by php serialize function $PromoteuserId='1'; $PromoteProductId='2'; $PromoteBrandId='3'; $PromoteProductArray = array("PromoteuserId"=>$PromoteuserId, "PromoteProductId"=>$PromoteProductId, "PromoteBrandId"=>$PromoteBrandId ); $Promotedcart[] = $PromoteProductArray; setcookie("Promotedcart", urlencode(serialize($Promotedcart)), time()+604800,'/'); And when the cookie is created then i am using the unserialize php function. print_r(unserialize(urldecode($