Access `session` within rails controller thread

前端 未结 2 1871
甜味超标
甜味超标 2021-01-28 04:35

How do I see / change session data from within a thread within rails? See this code snippet inside my controller:

def controller_action
  session[:something] = \         


        
2条回答
  •  梦谈多话
    2021-01-28 05:26

    Why do you need to change session data in a background thread?

    Are you using the default cookie store, because if you are I'm not sure how this would work. If you were to switch to the memcached/database session store you might have more luck as you can access the session after the request has finished.

提交回复
热议问题