开发者

How to work with session variables in php mvc pattern

开发者 https://www.devze.com 2022-12-24 10:30 出处:网络
I just found out that I loose any reference to the session array if I create 开发者_运维知识库a new view and try to set a session variable in the controller. The array just comes out as empty. I actua

I just found out that I loose any reference to the session array if I create 开发者_运维知识库a new view and try to set a session variable in the controller. The array just comes out as empty. I actually try to use the session array to store the post vars from a multistep registration form. This was actually working when the php was spachetticode, but now that I dumpt everything in a mvc pattern, it is not functioning anymore. Can anyone explain what is going om here and possibly offer a solution om how to work with the session array? Thanks in adv, Richard


Session mechanism has nothing to do with any design pattern. It should work with any.
No, noone can explain you what is going on. Only debugging can tell you.
Here we can only guess. Did you turn power on have session_start() on every page working with the session?


put the session_start(); on index.php

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号