0

据我了解,有两种方法可以获取 Shibboleth 属性:

  • 它们要么在 $_SERVER 上可用,要么
  • 在 HTTP 标头响应中(提供者的)

在后一种情况下,我怎样才能使它们对应用程序可用?即使我捕获它们一次并尝试使用 putenv() 将它们注入服务器环境,它也只会在当前请求的持续时间内。我可以在会话中加载它们,但感觉不对。

4

1 回答 1

1

If they went into the server's environment, then every user's values would overwrite everyone else's on every request. That's why there's sessions, to store per-user persistent data. Of course, you could have the server reinject on every request, into just the child/thread's environment for that particular request, but unless the values are changing each time, why not just put them in the session to begin with?

As well, in a multiple worker environment (like Apache's pre-fork), unless you somehow injected the variable into the parent process (the one that runs as root), you'd only be able to affect the one child. There's no guarantee that the next request will be processed by the same child. And even better, even if you injected the parent root-flagged process, the children wouldn't inherit that new environment until they naturally are shut down and the root parent forks a fresh child.

于 2010-10-18T20:42:34.663 回答