Log in

View Full Version : Session_id



city_coder
05-08-2008, 07:57 AM
Hi guys,

Iv got a unusual one, or at least one that iv not heard of or seen.

When i test my email system where you register and an email gets sent to the email address you provide, on my works server, it picks up the SID and puts it in the URL, which is what i want. But when i put it onto the live environment which is hosting company, it cant pick up the session id.

now i dont know if im doing it properly or not, but i must be to some extent.
all im doing is:
$0_SID = $PHPSESSID;
im just using $PHPSESSID, but the other server just doesnt seem to use that.

is there like a universal way of doing it?

cheers

Nile
05-08-2008, 11:46 AM
Do you get an error or anything? Or just the page is blank.

city_coder
05-08-2008, 12:04 PM
When i receive the email, all i get is http://www.mysite.com/index.php?SID=
and obviously where it has the SID it should have the sessio_id of the user when they went to sign up. Also the knock on effect is that it doesnt go into the database.

But solve one and il have solved the other.

Any advice? anything else i could try?

Master_script_maker
05-08-2008, 08:52 PM
can you show your code?

phpsales
05-08-2008, 09:10 PM
Please use the session_id() module (php.net/session_id) to get the current session id. The host your working on most likely has register globals disabled and/or session.use_only_cookies set to 1. Meaning the PHP session id will not be passed as a GET request variable for enhanced security.

More Information:
http://php.net/session_id
http://php.net/register_globals
http://us3.php.net/manual/en/session.configuration.php#ini.session.use-only-cookies


Sample Code:
$mySessionId = session_id();