Problems with $_SESSION |
[eluser]sherbo[/eluser]
I noticed that $_SESSION gets wiped out on each request. What's up with that? When I added a <?php session_start(); ?> snippet to the top of each page, the session is empty on each page. How do I correctly use the $_SESSION variable with CI?
[eluser]Rick Jolly[/eluser]
Are you putting session_start(); in the view? It should be in the controller before any session operations.
[eluser]sherbo[/eluser]
Ah yes, that was the problem. I had to put a <?php session_start(); ?> statement in each controller action.
[eluser]ELRafael[/eluser]
use session library!!! http://ellislab.com/codeigniter/user-gui...sions.html :-P
[eluser]Derek Allard[/eluser]
Yeah, the session library does offer all kinds of advantages for you, including security, flexibility and flashdata. Its pretty nice - give it a look ![]() |
Welcome Guest, Not a member yet? Register Sign In |