I have been hacking at a calendar all last week and it's come to the point now where I seem to have 2 sessions. When a user logs into the calendar it created a $_SESSION["login"] = <username> variable. But if I print_r the $_SESSION variable from another page then $_SESSION is empty. And if I assign a value to $_SESSION["test"] anywhere that <b>isn't</b> the login page then I can view it anywhere besides the login page. It's as if the login page and the rest of the calendar are seperate $_SESSION variables.
Has this problem been known before?
Regards,
I seem to have mutliple sessions.
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
It's not likely to be a problem with PHP, but your code or possibly your configuration choices. If you run phpinfo() what does the session section say during the login page and during another page? If you look at your cookie information regarding the session, what is the domain and path set to in each instance?
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Are you forgetting session_start() at the top of each page using the session?
-
impulse()
- Forum Regular
- Posts: 748
- Joined: Wed Aug 09, 2006 8:36 am
- Location: Staffordshire, UK
- Contact:
I found a function called in the code. Removing this seemed to sort the problem.
Code: Select all
session_name