added glob matching for ignored paths in hws
This commit is contained in:
26
cookies/doc.go
Normal file
26
cookies/doc.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Package cookies provides utilities for handling HTTP cookies in Go web applications.
|
||||
// It includes functions for setting secure cookies, deleting cookies, and managing
|
||||
// pagefrom tracking for post-login redirects.
|
||||
//
|
||||
// The package follows security best practices by setting the HttpOnly flag on all
|
||||
// cookies to prevent XSS attacks. The SetCookie function allows you to specify the
|
||||
// name, path, value, and max-age for cookies.
|
||||
//
|
||||
// The pagefrom functionality helps with user experience by remembering where a user
|
||||
// was before being redirected to login/register pages, then redirecting them back
|
||||
// after successful authentication.
|
||||
//
|
||||
// Example usage:
|
||||
//
|
||||
// // Set a session cookie
|
||||
// cookies.SetCookie(w, "session", "/", "abc123", 3600)
|
||||
//
|
||||
// // Delete a cookie
|
||||
// cookies.DeleteCookie(w, "old_session", "/")
|
||||
//
|
||||
// // Handle pagefrom tracking
|
||||
// cookies.SetPageFrom(w, r, "example.com")
|
||||
// redirectTo := cookies.CheckPageFrom(w, r)
|
||||
//
|
||||
// All functions are designed to be safe and handle edge cases gracefully.
|
||||
package cookies
|
||||
Reference in New Issue
Block a user