Comments (4)
A look at the clear function gives light on this!
#52
s.Session().Values
appears to be a list of all keys!
from sessions.
my session does not have .Session()? I assume that is what you meant by "s" ? Maybe?
r.GET("/", func(c *gin.Context) {
session := sessions.Default(c)
// the rest
... session is an interface
Lines 24 to 47 in 19716a2
from sessions.
@TJM I'm not sure that was 2 years ago, context could have been better on my behalf.
Reevaluating this, if you cast it to the actual implementation of the Session interface then there is an object in there.
For example the cookie implementation is:
https://github.com/gorilla/sessions/blob/master/sessions.go#L31
from sessions.
Sorry, I realized I had responded to a zombie issue after I already hit submit :)
Thanks, I will try that "cast" idea. Displaying all keys in the session is really sortof a debugging operation anyhow, but I can see how it might be useful enough to add a session.GetValues()
method. What do you think?
Also, the "example" code for session/cookie does not encrypt the cookies, so I was able to just use "Inspect" -> application -> cookie... and base64 decode (it was two different layers), and see what I was trying to see at the client level.
I was going to try to just "output" (c.JSON) everything in the session, but then I realized it was a waste of time/effort as that would not be something anyone would likely want to do.
Thanks,
Tommy
from sessions.
Related Issues (20)
- How to solve this err :gob: type not registered for interface: components.UserInfoInSession HOT 1
- How to delete a single session? HOT 1
- How to refresh the session HOT 3
- How to set different MaxAge for cookie and store(redis)
- Redis TLS support HOT 1
- this is a bug?the cookie will be covered! HOT 2
- Redis Cluster
- Question: How can I decode the cookie string?
- Remove archived gorilla packages HOT 3
- GetSession in gin-contrib/sessions returning nil of token HOT 5
- Redis store thread is not safe
- Session will not be registered on Redis store when setting Options on Redis store HOT 2
- why session.ID is empty
- 无法设masage为0
- warning: github.com/gomodule/[email protected]+incompatible: retracted by module author: Old development version not maintained or published
- When using redis, there is no sessionid depending to the max-age value
- github.com/mattn/[email protected]+incompatible HOT 1
- Mongo driver sets TTL index incorrectly
- panic: Key "github.com/gin-contrib/sessions" does not exist in unit test
- create redis store with a username and password
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sessions.