Wednesday, March 15, 2023
HomeGolangCookie associates not being established - Obtaining Assistance

Cookie associates not being established – Obtaining Assistance

The adhering to is my code for establishing a cookie with the builtin net/http. It sends out the cookie simply great however does not send out any one of the features in addition to it. I go to a loss for why.

// give token as cookie to frontend.
ck:= && http.Cookie {
Call: "token",.
Worth: "examination",.
Course: "",.
MaxAge: int( time.Now(). Include( time.Minute * 60). Unix()),.
HttpOnly: real,.
Secure: real,.
SameSite: http.SameSiteLaxMode,.
http.SetCookie( w, ck).

The header returned appear like such.

 Set-Cookie: token=<< legitimate token>>.

I’m anticipating something a lot more such as this:

 Set-Cookie: token=<< legitimate token>>; Course=/; Max-Age= 3600; HttpOnly; Secure; SameSite= Lax.

Previous article

Most Popular

Recent Comments