well first of froma design point of view you shouldn`t make those menu parts be viewed when you are not logged in...like my profile and such...
Now as for the session stuff...you have to be sure to include a session_start() on top of every php page....make sure you don`t have a session_destroy() or a unset somewhere where it shoudn`t be... if you figure out which part of the code has problems...post it here and you will find help for sure
I have included a file in every page called session.php where session_start script is located. But also its not working, what may be the problem?
could you paste your sessions.php file here? as without any code it is impossible to say what goes wrong.
No the problem was not solved. I said not all clicks on the links delete the session variables, just a link that point to search epals does that. Any solution?
Am I being stupid or is that a weird header thing? Also don't you want to set $_SESSION['username'] before checking if it's set?
What the most common reason for session destruction is the fact that session_start() is not the first thing on a page. Be sure that there are no whitespaces or no other form of text before session_start(), especially no HTML headers.
In general your code should look like:
<HTML>....rest goes here....</HTML>