![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
goa.design/examples/cookies
This example illustrates how to read and write HTTP cookies from a Goa service.
The session
service exposes two methods: create_session
and use_session
.
create_session
writes a cookie to the HTTP response and use_session
reads
it back.
The available DSL functions used to manipulate HTTP cookies are:
The following shows the DSL used to write the cookie:
HTTP(func() {
POST("/")
Response(StatusOK, func() {
Cookie("session_id:SID") // Return session ID in "SID" cookie
CookieMaxAge(3600) // Sessions last one hour
})
})
The value of the HTTP cookie SID
is read from the session_id
field of the
method result object.
The extract below shows the DSL used to read the cookie:
HTTP(func() {
GET("/")
Cookie("session_id:SID") // Load session ID from "SID" cookie
Response(StatusOK)
})
Build the server and the client:
go build ./cmd/session && go build ./cmd/session-cli
Run the server:
./session --http-port 8080
Run the client to create a session:
./session-cli -v -url http://localhost:8080 session create-session --body '{"name":"foo"}'
Run the client to use a session:
./session-cli -url http://localhost:8080 session use-session -session-id abcd
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.