Session not being generated by server, any gurus for help?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
gersh_ny
Forum Newbie
Posts: 7
Joined: Fri Jul 22, 2005 12:11 pm

Session not being generated by server, any gurus for help?

Post by gersh_ny »

Ok so my company is running some phpbb boards on a win 2000 server, all was working fine till over the weekend they decided to change over the DNS (this is done by SUN but I don’t have much details). Now the phpbb is running only on cookies and the session data is getting lost. I know it some setting on the server that needs to be changed, but I have no idea which. Anyone here have any idea what the issue could be?
Thanks all! :roll:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What do you mean by sessions are being lost? Can you find out what changes were made to the DNS?

Generally, this problem stems from the cookie being improperly set to begin with. For instance without reference to subdomain and path. Are you running the most recent version of phpbb? If you want it to reference the entire domain, remember to make it .domain.com (notice the leading dot.)
gersh_ny
Forum Newbie
Posts: 7
Joined: Fri Jul 22, 2005 12:11 pm

Post by gersh_ny »

feyd wrote:What do you mean by sessions are being lost? Can you find out what changes were made to the DNS?

Generally, this problem stems from the cookie being improperly set to begin with. For instance without reference to subdomain and path. Are you running the most recent version of phpbb? If you want it to reference the entire domain, remember to make it .domain.com (notice the leading dot.)
The most obvious way i see it not being generated is the sid in the URL comes empty and in the past it generated a random sid. Also all the users data such as who is online and so on come empty. The cookies seem to be set correctly because everything that depends on the cookies is working fine. Any thoughts on what setting they should be changing… ? They don’t seem to be able to pin point the problem and I know no code changes were made. And no i don’t know what setting were changed.. i am not very familiar with DNS.
Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

okay, so let me get the scenario right in my head:

In a fresh browser (no cookies for the site) you hit the index. The links off that main page should have a SID attached. If the SID is not there, then the generation of the SID is broken. At this point, a cookie or two should have set. Check their specific settings (in Firefox this is far easier). If you have the cookies, then they at least match the domain and path you are currently looking at. If you follow a link (the index link is often best), all links on the following page should not have a SID in the url. If they do, the cookies either did not set or did not match the link's domain and path information. If phpbb is configured to run off of http://www.domain.com, but can now be seen by other subdomains, this sort of problem can present (as the cookies will only match the original domain setting, likely)

Verify that the cookie settings are for the full domain, as I said before and the path is only a /
gersh_ny
Forum Newbie
Posts: 7
Joined: Fri Jul 22, 2005 12:11 pm

Post by gersh_ny »

feyd wrote:okay, so let me get the scenario right in my head:

In a fresh browser (no cookies for the site) you hit the index. The links off that main page should have a SID attached. If the SID is not there, then the generation of the SID is broken. At this point, a cookie or two should have set. Check their specific settings (in Firefox this is far easier). If you have the cookies, then they at least match the domain and path you are currently looking at. If you follow a link (the index link is often best), all links on the following page should not have a SID in the url. If they do, the cookies either did not set or did not match the link's domain and path information. If phpbb is configured to run off of http://www.domain.com, but can now be seen by other subdomains, this sort of problem can present (as the cookies will only match the original domain setting, likely)

Verify that the cookie settings are for the full domain, as I said before and the path is only a /
Well the cookies seem to be set correctly, therefore if you come back to the site u will be logged in. When user logs in first time, the cookies will not be set and it will show you as not logged in . None of the settings in the code have changed and cookies still reside in the same location as before.. I am sure it is a sessions issue but cant pin point the problem.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

if it was a session issue specifically, everyone would be affected normally..
gersh_ny
Forum Newbie
Posts: 7
Joined: Fri Jul 22, 2005 12:11 pm

Post by gersh_ny »

feyd wrote:if it was a session issue specifically, everyone would be affected normally..
I hear you it is odd, but all right cookies are getting set. The most obvious way the problems manifests it self, is by not generating the SID that is usually attached to the URL. I assume this is a sessions problem, I did create a test page that just echoes SID and that displayed empty…., any ideas?
Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

maybe a link to the page would be helpful, so we can analyze the situation ourselves?
gersh_ny
Forum Newbie
Posts: 7
Joined: Fri Jul 22, 2005 12:11 pm

Post by gersh_ny »

feyd wrote:maybe a link to the page would be helpful, so we can analyze the situation ourselves?

Well unfortunately I can not post the URL because it is a secure paid site, where only site members could enter the forums. But feel free to ask me additional questions, and thanks a lot for taking the time feyd.
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

Well, phpbb2 doesn't really use sessions. :)

Phpbb2 doesn't use the PHP session handler at all. So this really isn't a PHP session problem. :)

In the configuration portion of the General Admin area of PHPBB2 you need to make sure the Domain name and the Cookie domain both match. The Cookie path should be / most of the time and give the Cookie Name a unique name. In many cases if the cookie name and domain name do not match phpbb2's session code will fail to create sessions.

If you have phpbb2 in the same directory path as the web site but use a different url prefix then you need to do this slightly different.

Say the domain name is forums.aatraders.com but the forums are located under http://www.aatraders.com/phpbb2 then the Domain Name in the configuration should be forums.aatraders.com, script path is /, Cookie domain is aatraders.com (notice no prefix) and Cookie path is /. That should cover most setups.

I hope I haven't confused anyone too much. :)
gersh_ny
Forum Newbie
Posts: 7
Joined: Fri Jul 22, 2005 12:11 pm

Post by gersh_ny »

AKA Panama Jack
Sounds like some really valid points i will look into it.
Thanks a lot.
gersh_ny
Forum Newbie
Posts: 7
Joined: Fri Jul 22, 2005 12:11 pm

Post by gersh_ny »

AKA Panama Jack wrote:Well, phpbb2 doesn't really use sessions. :)

Phpbb2 doesn't use the PHP session handler at all. So this really isn't a PHP session problem. :)

In the configuration portion of the General Admin area of PHPBB2 you need to make sure the Domain name and the Cookie domain both match. The Cookie path should be / most of the time and give the Cookie Name a unique name. In many cases if the cookie name and domain name do not match phpbb2's session code will fail to create sessions.

If you have phpbb2 in the same directory path as the web site but use a different url prefix then you need to do this slightly different.

Say the domain name is forums.aatraders.com but the forums are located under http://www.aatraders.com/phpbb2 then the Domain Name in the configuration should be forums.aatraders.com, script path is /, Cookie domain is aatraders.com (notice no prefix) and Cookie path is /. That should cover most setups.

I hope I haven't confused anyone too much. :)
I tried all of you suggestions but the urls sid is not getting generated, thereby disabling a lot of the phpbb features. Being that you seems to know the system pretty well do u have any other ideas on what could be causing this. Keep in mind it was all working till we switched over the DNS to a new ip.
Post Reply