Fork me on GitHub
#ring
<
2017-12-08
>
sova-soars-the-sora00:12:45

@weavejester thanks I just grabbed (first and (second ...

sova-soars-the-sora00:12:07

I feel bad to ask so many questions to you, but I have one more...

sova-soars-the-sora00:12:23

how can I write directly to the session? is the session data stored on the clientside?

sova-soars-the-sora00:12:33

I want to change the session data via sente event, which does have a ring-map but i don't think affecting the incoming copy of the ring parameters would do anything to the session. it seems like a redirect / url shift would be required to change session data w/ my understanding at this point

weavejester00:12:05

@sova It depends how you’re storing the session.

weavejester00:12:22

What session store are you using?

sova-soars-the-sora07:12:30

@weavejester i want to write directly to the ring session, as part of the map, if possible. my current scheme just stores at atom in the clientside of login email, login time, and hash.

sova-soars-the-sora07:12:46

user submits info over socket -> gets authentication information over socket

sova-soars-the-sora07:12:42

but I want to make sure that if a user navigated to say /article/:whatever they would still have their login creds active. writing to localStorage won't persist this if the user has localStorage disabled, so i am thinking having ring session as a directory-level fallback

sova-soars-the-sora07:12:55

does my approach make sense? maybe the authentication can all be ring session level...

sova-soars-the-sora07:12:16

to be honest, i was not aware that there are different ways to store the session. what are the alternatives? (googles furiously)

weavejester12:12:24

@sova Sessions persist over requests, so they require some form of storage. By default, Ring provides two stores: an in-memory atom held on the server, and through encrypted cookies. You can also use third-party stores, or write your own, that store sessions on the filesystem or in a database.

weavejester12:12:59

You can access the store directly to update the session in most cases. Cookie stores are an exception, since they require a HTTP response.

weavejester12:12:10

If you want to have the session stored when the user logs in via a session, you need some way of setting a cookie. I believe you could do this via an XHR, or you could grab the value of the session cookie and set it with Java/Clojurescript instead.