Smarty kills my session
问题 I have a problem with Smarty 3.1.13. Smarty kills my session. Every time I refresh my page, $_SESSION array is empty. When I comment line $smarty->display('index.tpl') , everything is OK. Any ideas? 回答1: You have to start your session before $smarty->display('index.tpl') This is beacause the session cookie needs to be send in the HTTP header and therefore session_start will need to be called before the first line of output. So make sure session_start() is placed before $smarty->display('index