Get rid of session_write_close();
What exactly is happening to make you think your session is lost?
Are you trying to use your session variables after a refresh and they don't work?
Try this:
After you set your session for username, put
somewhere on the page. This will display the username on the page. Hit refresh and see if it is still displayed.Code:echo $_SESSION['CurrentUser'];
If it is still displayed, then you'll know that your problem is somewhere else.
Post more of your code too. You might have a problem, but it isn't in the code you have posted.
Good Luck!



Reply With Quote

Bookmarks