开发者

Session variable works on local server, but not on hosting server

I开发者_开发问答 am developing a simple php/mysql discussion forum. The statement

<?php print $_SESSION['username']; ?> 

produces the desired results on my local machine, but when I uploaded the code to test the forum live, the value of the session variable no longer displayed. What could be causing this?


one thing that can cause this is if the live web server is on a load balanced environment using default php session handling. By default php stores session data in a flat file on ther server so if the user is jumping around webheads they will lose session data.

in that case you will need to define your own session handler using a db

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜