All Questions
8
questions
0
votes
1
answer
947
views
Response header have cookie but not store in browser , Next js 13 App dir / go , gin server
Access-Control-Allow-Credentials:
true
Access-Control-Allow-Origin:
*
Content-Length:
58
Content-Type:
application/json; charset=utf-8
Date:
Sun, 22 Oct 2023 03:36:23 GMT
Set-Cookie:
jwt_token=...
-1
votes
1
answer
613
views
Golang SetCookie method does not set cookie
I am writing a simple Login handler. Everything works just fine except setting the cookie.
Here is the code :
.
.
.
cookie := &http.Cookie{
Name: credentials.EmailAddress,
...
1
vote
1
answer
233
views
cookie not saved by browser
Tried 15648070,15648070 and didn't work unfortunately :)
Hi there, first time building an API with Gin, and I'm having some issues setting a cookie on my browser
I mean, when viewing the request on ...
2
votes
0
answers
1k
views
Golang Gin Set Cookie not setting in Browsers [closed]
So I have a backend golang gin api hosted at domainA.com , I also have a frontend Next.js web app hosted at domainB.com . So I have a login page were users will login, the fetch call goes to domainA ...
1
vote
1
answer
2k
views
How to unit test extraction from cookie in Gin Gonic
I'm using gin gonic. I've a function that extracts a token from a cookie, which actually works. I'm using this function in a route handler and want to test the handler function, but I don't know how.
...
1
vote
2
answers
5k
views
How to check if a cookie is expired
How do I check if a cookie I get through a GET request is expired or not?
I tried:
cookie, err := c.Request.Cookie("session")
if err == nil && time.Now().Before(cookie.Expires) {
log....
1
vote
0
answers
2k
views
How To set domain for cookie golang with "contrib/sessions" package, gin gonic
Please help me!. I wanna set domain for my cookie,
In my main function, i set :
store := sessions.NewCookieStore([]byte("secretkey"))
store.Options(sessions.Options{
Domain: "myexample.com",
})
...
4
votes
2
answers
18k
views
go-gin unable to set cookies
I am trying to set a cookie on an HTML page
func testCookie(c *gin.Context) {
c.SetCookie("test1", "testvalue", 10, "/", "", true, true)
c.HTML(200, "dashboard", gin.H{
"title": "...