Sessions and Template |
[eluser]rrasco[/eluser]
*Please see post #3 for updates: http://ellislab.com/forums/viewreply/575399/ I have an app that is having problems with session. I didn't build this app, I was just supposed to integrate it into the design. I utilized the template library to do this. However, I am having some issues with session data not being stored correctly. I have a page that lists contests, and in doing so, it stores the contest_id as session data so it can be used on the next action. The action is enter($id), so an example URL would be: index.php/contests/enter/10. If I echo $id, I get a result of 10. I use $id to assign the session data: Code: $this->session->set_userdata('contest_id', $id); This should store 10 as session variable 'contest_id'. I can verify this by: Code: echo $this->session->userdata('contest_id'); // this returns a value of 10 as well The problem is, when I attempt to use 'contest_id' it returns a value other than 10, it is actually assigning 'img' to the session item in the db. This happens with sessions db enabled/disabled. All other session data is being stored correctly. Code: a:7:{s:10:"contest_id";s:3:"img";s:3:"uid";s:1:"6";s:6:"logged";s:1:"y";s:9:"entry_fee";s:5:"25.00";s:3:"adu";s:6:"capear";} This problem seems to arise after the Template library is used. Does anyone know if there are known issues with Template interfering with session data? Or any other reason this may happen? TIA
[eluser]rrasco[/eluser]
This is the template library I used: http://williamsconcepts.com/ci/codeignit...rence.html
[eluser]rrasco[/eluser]
I have narrowed the bug down a bit. I removed the templating system to eliminate that as a cause and isolated it down to a portion of code; code is notated. I am extremely new to CI and could use some guidance. *NOTE: The forums were not liking the siteurl() parameters, so I omitted them. Code: function enter($id)
[eluser]TheFuzzy0ne[/eluser]
I'm totally baffled. I wouldn't have thought the template library should have anything to do with sessions. Please let us know how you get on with tracing the problem. |
Welcome Guest, Not a member yet? Register Sign In |