An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 5.5% on proxy.golang.org
Top 5.8% dependent packages on proxy.golang.org
Top 4.8% dependent repos on proxy.golang.org
Top 6.2% forks on proxy.golang.org

proxy.golang.org : github.com/chmike/securecookie

Package securecookie is a fast, efficient and safe cookie value encoder/decoder. A secure cookie has its value ciphered and signed with a message authentication code. This prevents the remote cookie owner from knowing what information is stored in the cookie or modifying it. It also prevents an attacker from forging a fake securecookie. What makes this secure cookie package different is that it is fast (faster than the Gorilla secure cookie), and the value encoding and decoding needs no heap allocations. The intended use is to instantiate all secure cookie objects of your web site at program start up. In the following example "session" is the cookie name. The key is a byte sequence generated with the GenerateRandomKey() function. The same key must be used to retrieve the value. An securecookie can also be instantiated as a global variable with the MustNew function. The function will panic if an error occurs. A securecookie object is immutable. It's methods can be called from different goroutines. The Delete(), SetValue() and GetValue() methods are independent. To set a cookie value, call the SetValue() method with a http.ResponseWriter w, and a value val as arguments. A securecookie value is retrieved from an http.Request with the GetValue() method and is appended to the given buffer, extending it if required. If buf is nil, a new buffer is allocated. A securecookie is deleted by calling the Delete() method with the http.ResponseWriter w as argument.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/chmike/securecookie
License: MIT
Latest release: over 2 years ago
First release: almost 7 years ago
Namespace: github.com/chmike
Dependent packages: 1
Dependent repositories: 1
Stars: 67 on GitHub
Forks: 11 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 23 days ago

    Loading...
    Readme
    Loading...