otak info official Logo   
OTAK.INFO
Personal Blog

Hariyanto Lim

정길상 / 鄭吉祥
Home   Last Posts  
 
Please login to see more topics and discussion categories.
 
goto main category list >> Software programming >> PHP

Title : Session value lost problem
Total Reply : 0
Total View : 1734


Harry
Harry
Total thread: 131
Total reply: 50

Post #10
Session value lost problem
In normal case the session if the server is configured properly then it should not be a problem, using Wamp server 2.2 for my localhost, I can do this without problem:
'
'.str_replace('
', ' ', '
$memberId = 0;
if(isset($_SESSION['memberId'])) {
$memberId = intval($_SESSION['memberId']);
}
').'
'
But sometime the above code has problem when uploaded into real remote hosting, the $_SESSION['memberId'] value is gone when I call isset(), so I use
'
'.str_replace('
', ' ', '
$memberId = intval($_SESSION['memberId']);
').'
'
Without checking the existence of $_SESSION['memberId'], this will generate PHP warning if not exist but it works.
Falling in love with the world

Write : 2013-06-26 07:51:40

If you want to create a new reply then please login first.



www.OTAK.INFO
Since 19 January 2007
Page hit : 886,419

Code update 24th June 2013
Brain is a very capable to solve big problems
but requires constant reminders about how to.
peace bird