Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Session Values field to be non-exported #18

Merged
merged 1 commit into from
Dec 31, 2022

Conversation

dghubble
Copy link
Owner

  • Add Session methods to access session state key/value pairs
  • Use Session Set to set a key/value pair
  • Use Session Get to get a value for a given key
  • Use Session GetOk to get a value for a given key and whether the key exists in the map
// add user-id to session
- session.Values["user-id"] = 123
+ session.Set("user-id", 123)

// get user-id from session
- userID := session.Values("user-id")
+ userID := session.Get("user-id")

* Add Session methods to access session state key/value pairs
* Use Session Set to set a key/value pair
* Use Session Get to get a value for a given key
* Use Session GetOk to get a value for a given key and whether
the key exists in the map
@dghubble dghubble force-pushed the stop-exporting-values branch from 9938047 to df8e48f Compare December 31, 2022 04:26
@dghubble dghubble merged commit df8e48f into main Dec 31, 2022
@dghubble dghubble deleted the stop-exporting-values branch December 31, 2022 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant