XF 2.2 Piece of data persisting from guest session to user session

digitalpoint

Well-known member
Figured it would be easy enough to ask the question in case there's a built-in mechanism to retain something from a guest session to a logged in/registered user session.

Currently I'm grabbing the existing session variable I stored within the XF\Session\Session::changeUser() method (before $this->regenerate(false)), then add it to the new session after $this->regenerate(false) is called. Not trying to call $this->regenerate(true) (keeping existing data, although it does appear to work) because I don't know what the ramifications are of keeping all the session variables that I don't care about.

Just wondering if there's a better way to do this without needing to extend the Session class, or if I'm going about it the best way.
 
I was curious if you figured this out? I'm trying to do the same thing from the sounds of it...

I'd like to persist a custom session variable from a guest session through to the logged in session (everything appears to be "expunged" on "regenerate").

Cheers!
 
To be honest, I don't even remember what it was that I was working on at the time, so I don't remember exactly if I fixed it. I grepped through my stuff and there's nowhere that I'm extending the Session class, so I must have ended up doing it another way. Unfortunately since I don't even remember what I was working on, it's tough to look to see how I sorted it out. haha
 
Back
Top Bottom