Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

A big problem with SESSIONS

Question posted by: gamernaveen (Newbie) on May 9th, 2008 10:09 AM
Hello everyone , am running PHP 4.
I dont use SESSION IDs in URL.
This is what the problem is.
I set a session in file
Code: ( text )
  1. http://vegetariancooking.mobi/index.php
, it works fine , and displays the session too. However , when I goto
Code: ( text )
  1. http://www.vegetariancooking.mobi/index.php
, why isnt the session displaying ?
I mean the session value ?
Please help me , thank you so much.
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
markusn00b's Avatar
markusn00b
Expert
1,745 Posts
May 9th, 2008
11:32 AM
#2

Re: A big problem with SESSIONS
Quote:
Originally Posted by gamernaveen
Hello everyone , am running PHP 4.
I dont use SESSION IDs in URL.
This is what the problem is.
I set a session in file
Code: ( text )
  1. http://vegetariancooking.mobi/index.php
, it works fine , and displays the session too. However , when I goto
Code: ( text )
  1. http://www.vegetariancooking.mobi/index.php
, why isnt the session displaying ?
I mean the session value ?
Please help me , thank you so much.


No idea.

Us seeing your code might help?

Reply
dlite922's Avatar
dlite922
Needs Regular Fix
406 Posts
May 10th, 2008
07:53 AM
#3

Re: A big problem with SESSIONS
Quote:
Originally Posted by gamernaveen
Hello everyone , am running PHP 4.
I dont use SESSION IDs in URL.
This is what the problem is.
I set a session in file
Code: ( text )
  1. http://vegetariancooking.mobi/index.php
, it works fine , and displays the session too. However , when I goto
Code: ( text )
  1. http://www.vegetariancooking.mobi/index.php
, why isnt the session displaying ?
I mean the session value ?
Please help me , thank you so much.


That's how sessions work, I believe for security reasons.

If the URL changes anywhere between the HTTP and the .COM. the session will not register.

This is even true when switching between HTTPS and HTTP when the rest of the domain name is the same.

Try passing the session with GET to the new URL, then store it in the session there.

Good luck,


-Dan

Reply
Reply
Not the answer you were looking for? Post your question . . .
170,098 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top PHP Forum Contributors