cookies

Flask – multiple session cookies with the same name

故事扮演 提交于 2021-01-21 04:22:04
问题 I have found a very strange problem in my Flask application. I discovered that in some circumstances multiple session cookies could be created with the same name. I attached a picture about it. It is not browser specific. It is strange itself, but the real problem comes when I try to validate a form with CSRF token. Unfortunately, Flask picks a wrong session cookie and the validation of the CSRF token cannot be successful. And even more strangely the problem persists even after multiple form

Sticky sessions on Kubernetes cluster

霸气de小男生 提交于 2021-01-21 04:04:22
问题 Currently, I'm trying to create a Kubernetes cluster on Google Cloud with two load balancers : one for backend (in Spring boot) and another for frontend (in Angular), where each service (load balancer) communicates with 2 replicas (pods). To achieve that, I created the following ingress: apiVersion: extensions/v1beta1 kind: Ingress metadata: name: sample-ingress spec: rules: - http: paths: - path: /rest/v1/* backend: serviceName: sample-backend servicePort: 8082 - path: /* backend:

I need that the last 3 searches are saved in a cookie and displayed

本秂侑毒 提交于 2021-01-07 02:53:40
问题 I want the last 3 searches to be saved in a Cookie and displayed in a '< p>' tag. Here is my HTML code: <form class="Dform" method="POST" action="index.php"> <input type="text" name="search" value=""> <input type="submit" name="" value="Search"> </form> I only managed to display the previous search but I don't know how to do the 2 previous ones, here is my php code: <?php if (!empty($_POST['search'])) { setcookie('PreviousSearch', $_POST['search'], time()+60*60,'',localhost); } ?> <?php $r1 =

Why is the browser not setting cookies after an AJAX request returns?

萝らか妹 提交于 2021-01-07 02:35:54
问题 I am making an ajax request using $.ajax. The response has the Set-Cookie header set (I've verified this in the Chrome dev tools). However, the browser does not set the cookie after receiving the response! When I navigate to another page within my domain, the cookie is not sent. (Note: I'm not doing any cross-domain ajax requests; the request is in the same domain as the document.) What am I missing? EDIT : Here is the code for my ajax request: $.post('/user/login', JSON.stringify(data));

How do I clear cookies on Expo AuthSession.startAsync on Android

别来无恙 提交于 2021-01-04 13:59:27
问题 I am running into issues on Android where I can not get back to the login screen for external logins when using AuthSessions.startAsync once I am signed in. This allows me in once, but then I always just get logged straight back in again rather than being prompted for which account to log in with. I have no need with my app to eject, so I really do not want to unless I really have to. I've read from the following link that this is possible. https://medium.com/@manoj_makkuboy/clear-cookies-in

I can't set the SameSite attribute of the cookie to None in Nodejs (Express)

邮差的信 提交于 2021-01-04 07:53:33
问题 We are creating a backend for a Twitter view app in Nodejs (Express). I'm thinking of using Twitter Api for login and storing the token returned after authentication to the session and then restoring the session from the cookie when it is accessed again. However, the cookie is blocked when it is accessed again and I can't restore the session information. The browser I use is chrome, but since chrome version 80, SameSite attribute seems to be Lax (sends a cookie when called from the site of

I can't set the SameSite attribute of the cookie to None in Nodejs (Express)

痴心易碎 提交于 2021-01-04 07:50:54
问题 We are creating a backend for a Twitter view app in Nodejs (Express). I'm thinking of using Twitter Api for login and storing the token returned after authentication to the session and then restoring the session from the cookie when it is accessed again. However, the cookie is blocked when it is accessed again and I can't restore the session information. The browser I use is chrome, but since chrome version 80, SameSite attribute seems to be Lax (sends a cookie when called from the site of

Cannot remove a cookie - Firefox rejecting cookies from the past

≡放荡痞女 提交于 2021-01-04 07:22:39
问题 I'm losing my mind here - I'm looking into an issue where some signout functionality in an application I have isn't working because the authentication cookie is not being cleared. The thing is that our "signout" endpoint does include the appropriate set-cookie header in the response - here's what I get looking at the raw response in Firefox: set-cookie: Auth.myapp=; domain=app.mydomain.com; expires=Thu, 26-Nov-2020 13:19:20 GMT; path=/; secure; HttpOnly Firefox is reporting this error in the

Cannot remove a cookie - Firefox rejecting cookies from the past

穿精又带淫゛_ 提交于 2021-01-04 07:21:35
问题 I'm losing my mind here - I'm looking into an issue where some signout functionality in an application I have isn't working because the authentication cookie is not being cleared. The thing is that our "signout" endpoint does include the appropriate set-cookie header in the response - here's what I get looking at the raw response in Firefox: set-cookie: Auth.myapp=; domain=app.mydomain.com; expires=Thu, 26-Nov-2020 13:19:20 GMT; path=/; secure; HttpOnly Firefox is reporting this error in the

Let the user choose between dark and light mode (save settings for every page, cookies?)

不羁岁月 提交于 2021-01-03 01:07:47
问题 I have just recently started using javascript and jQuery so I'm not an expert and at the moment I am struggling with what I guess could be called a "basic task"? I want to include two buttons on the homepage with which the user can the website mode to either dark or light. These settings should then be remembered as the user enters the website and clicks on the different links. So far I have added the function that changes the background color and color of the font onClick but I can only do