Comments (7)
Please provide a test case and a screenshot of the browser as well as the exact version of the browser.
from rocket.
Browser : Microsoft Edge
Version 121.0.2277.112 (Official build) (64-bit)
here is the cookie after "removal" , content is erased but this remains
Name
test_cookie
Content
Domain
Path
/
Send for
Same-site connections only
Created
Friday, February 16, 2024 at 12:28:14 AM
Expires
Sunday, September 20, 5838270 at 12:09:20 AM
the code is pruned from other routes :
use rocket::*;
use rocket::http::{Cookie,CookieJar};
#[get("/set_cookie")]
async fn set_cookie(cookies: &CookieJar<'_>,) {
cookies.add(Cookie::new("test_cookie", "val"));
}
#[get("/remove_cookie")]
async fn remove_cookie(cookies: &CookieJar<'_>) {
cookies.remove("test_cookie");
}
#[tokio::main]
async fn main() -> Result<(), Error> {
let _ = rocket::build()
.mount("/", routes![set_cookie,remove_cookie])
.launch()
.await?;
Ok(())
}
from rocket.
I'm sorry, but you're going to need to provide clearer information about what's going on. I have tried to reproduce the issue you're describing without success. On both macOS and Windows, Edge successfully clears the cookie.
Here's what I need from you:
- A console log of Rocket with your reproduction showing incoming and outgoing requests where the issue occurs with debug logging enabled. This was requested in the issue template but was ignored.
- A screenshot of the developer tools in your Edge browser that shows the information you're describing here. When a cookie is deleted, both
max-age
andExpires
are set. I need to see what the browser is receiving, exactly. Ideally, this is two things: the response headers and the cookie information.
Please also format your responses with markdown so that they're easier to read.
Please do not ignore issue templates in the future. They are designed so that this back-and-forth is avoided as much as possible. When you ignore the issue template, you increase workload on maintainers unnecessarily.
from rocket.
rocket log writes as expected:
sending response: Response {
status: 200,
version: HTTP/1.1,
headers: {
"set-cookie": "test_cookie=; SameSite=Lax; Path=/; Max-Age=0; Expires=Thu, 16 Feb 2023 01:41:49 GMT",
"server": "Rocket",
"x-content-type-options": "nosniff",
"x-frame-options": "SAMEORIGIN",
"permissions-policy": "interest-cohort=()",
"content-length": "0",
},
body: Body(
Streaming,
),
}
and I get only this warning in Edge developer tools console:
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'interest-cohort'.
Edge keeps setting the cookie expiration date at : Sunday, September 20, 5838270 at 12:09:20 AM
from rocket.
I get the same behavior from Edge on a linux machine
from rocket.
Please post the following:
I need to see what the browser is receiving, exactly. Ideally, this is two things: the response headers and the cookie information.
This can be found in the developer tools.
Also, is your clock set correctly?
from rocket.
When an inspect cookies in the Application tab of developer tools, the cookie doesn't show after removal which is good
I added the route
#[get("/check_cookie")]
async fn check_cookie(cookies: &CookieJar<'_>)->String {
match cookies.get("test_cookie") {
Some(_)=>String::from("Cookie found"),
_=>String::from("Cookie not found"),
}
}
and everything is ok
Meanwhile the cookie still shows up in "View Site Information --> Cookies" ,which might be annoying from a user perspective.
anyway , this seems to be related to Edge implementation so I suppose we can close the issue
from rocket.
Related Issues (20)
- Possible Incompleteness HOT 1
- Possible Incompleteness HOT 1
- doc: change `&ContentType` with `&Accept` in the list of implementations of `FromRequest` HOT 1
- [Feature]: Enhanced State Mutation for Effortless Handling of Shared Resources HOT 5
- Guide navigation causes relative links inside articles to 404 HOT 1
- Redirection to a route which takes a vector parameter results in an error HOT 1
- Allow users to create of Data<'r> objects HOT 5
- Validation not invoked on Json HOT 6
- Implement `FromForm` for `Range` HOT 1
- Missing license files in rocket_codegen-0.5.0.crate HOT 2
- Add SQLite extensions HOT 2
- Middleware that handles requests for static resources HOT 2
- Unable to build: no `Serialize` in `de` HOT 3
- Add default content_type for TempFile uploads HOT 2
- Could not find `json` in `serde` HOT 1
- Can't change IP that Rocket starts from. HOT 1
- Clippy lint: temporary with significant `Drop` can be early dropped HOT 1
- Rocket sometimes resets connection instead of responding with 413 error response HOT 2
- MiniJinja can't be used for templates HOT 1
- Routing by hostname HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rocket.