Current location: Hot Scripts Forums » Programming Languages » PHP » unknown problem - probably $session issue


unknown problem - probably $session issue

Reply
  #1 (permalink)  
Old 03-18-06, 11:45 PM
clantron clantron is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Question unknown problem - probably $session issue

I have 2 websites running with $session...
one of them is a game the other a community site.
one runs in dir domain.com/a
other runs in dir domain.com/b

I have a link from community to game which goes like following:
<code>
<A href="link.domain.com/B" target="_blank">link</a>
</code>

Now following happens.
After visiting community site page A then clicking on link gives no problem.
After visiting com site page A then page B then clicking on link seems to give a lot of errors to the game site. All are on lines that have $session in it.

Now I'm wondering what this could be.
I am asuming it's $sessions that are mixing up.
And if it is that then how could I solve this?

Also the problem seems to persist once it started. Untill the broswer (IE) is closed. Then when trying again it's ok for the first link.
I hope I'm making any sense...

What I think happens is that the link is somehow forwarding the $session info to the other. I'm not sure.
If it could be anything else please let me know.

I can't really give any code because there's quite a bit of code involved here and I've no idea where the problem lies except for the $session part.

Thanks in advance.
__________________
"I don't know the key to success, but the key to failure is to try to please everyone."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-19-06, 12:20 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
How about giving some of the errors?

A session for a user should be accessible for any page within a single domain. I don't know if this applies to sub-domains. Do sessions work in general, except for this case?
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-19-06, 12:41 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
The default for the session.cookie_domain is nothing "". It is possible that the session cookie was created using the full domain of the starting page. If so, this could lockout access from a subdomain. The PHP manual for cookies recommends -
Quote:
To make the cookie available on all subdomains of example.com then you'd set it to '.example.com'. The . is not required but makes it compatible with more browsers. Setting it to www.example.com will make the cookie only available in the www subdomain.
Perhaps set session.cookie_domain to '.yourdomain.com'
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 03-19-06, 08:48 AM
clantron clantron is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
sorry got so tired after 5 hrs of looking at it I went soon to bed...
Here are the errors... after posting those I'll go look at the cookies see if anything is there.

Code:
Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 677

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 752

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 764

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 771

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 774

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 775

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 776

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 787

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/lib/common_includes.php on line 11

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 319

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 320

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 321

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/lib/funct_page.php on line 25

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 319

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 320

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 321

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/index.php on line 38

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 201

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/common.php on line 201

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/lib/funct_page.php on line 110

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/lib/funct_page.php on line 111

Warning: Division by zero in /home/drakestone/www/rpg/lib/funct_page.php on line 112

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/lib/funct_page.php on line 114

Warning: Cannot use a scalar value as an array in /home/drakestone/www/rpg/lib/funct_page.php on line 115
__________________
"I don't know the key to success, but the key to failure is to try to please everyone."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 03-19-06, 09:28 AM
clantron clantron is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
made the cookies completely seperate now.
didn't fix the problem tho.
__________________
"I don't know the key to success, but the key to failure is to try to please everyone."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 03-19-06, 09:45 AM
clantron clantron is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
ok I made a work around just now ...

What I did is following:

I created a redirect.php
inside that I have a 1 sec redirect
and a
PHP Code:

session_destroy(); 

This seems to stop the errors from coming, which proves it's a session issue that's being carried over...
If you've any other ideas besides this redirect lemme know

For now however, thanks for your time and help.
__________________
"I don't know the key to success, but the key to failure is to try to please everyone."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 03-19-06, 02:36 PM
clantron clantron is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
*sigh*
cheered too soon.
it seems that if both sites are active at the same time the errors come back
I've no clue why the sessions are being brought over between 2 opened websites in 2 browser screens.

They dont even have the same login system

Any ideas would be appreciated....

UPDATE:
ok several hours ago I set up a new subdomain for the game part...
that's active now ..
for some reason the sessions do not seem to conflict as long as the link is game.website.com when I use www.website.com/game that it goes wrong. It doesn't make sense to me but it seems to work that way...
__________________
"I don't know the key to success, but the key to failure is to try to please everyone."

Last edited by clantron; 03-19-06 at 03:04 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue Tracking and Task management SlackeR Script Requests 8 10-05-05 05:29 PM
CPU Overusage Issue Amulet PHP 3 03-16-05 03:10 AM
Count problem kasic ASP.NET 1 10-20-04 01:23 AM
Asp and Microsoft Access 2002 problem gop373 ASP 2 10-06-04 10:13 AM
unknown problem with upload script rush989 PHP 3 08-31-04 02:56 AM


All times are GMT -5. The time now is 12:30 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.