Transfering session from page to page...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gostly
Forum Newbie
Posts: 2
Joined: Sun Jul 23, 2006 7:19 pm

Transfering session from page to page...

Post by gostly »

Alright, i recently switched to a new server...the difference between them is my old server was using php 4, the new server is php 5...i had my php.ini setup to trans_sid = 1 and it would pass the SID through every page automatically like it's supposed to, now on my new server i set the php.ini the same way but it doesnt pass the SID through every page and infact it doesnt even recognize the SID as a function in itself (like echo SID; wont echo anything out)...anyways ive been trying different solutions but when it comes down to it i need every page to pass through with the SID...someone please help me out i really need this
bdlang
Forum Contributor
Posts: 395
Joined: Tue May 16, 2006 8:46 pm
Location: Ventura, CA US

Post by bdlang »

Can you show us the 'sessions' section from phpinfo() output?

Please show an sample of the code you're trying to get working.

Make sure every script has session_start() at the top.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Allow me to make a few corrections: SID is a constant, not a function. The session ID doesn't absolutely have to be on all pages, only when the cookie it would normally attempt to use doesn't work. It normally does this on the first page, but after reaching the second page they are not in the URL.

Now, as for a solution.. You may need to check your error logs, a permission may be screwed up and the session data may not be able to write out. Other things to check is, if the session cookie is being set.. if it is, then this sounds like the normal behaviour I said above.

session_id() may be of interest too.
gostly
Forum Newbie
Posts: 2
Joined: Sun Jul 23, 2006 7:19 pm

Post by gostly »

it was the weirdest problem, trans_sid was set to 1 in the ini file and yet it wouldnt work...my server came with php 4.4.3 or something similar, and then i upgraded to 5.1.4...and then i found out it wasnt working and alot of my pages needed the SID passed through to verify things, and session_id() was showing the session id, the constant SID wasnt showing anything though...

but anyways, i fixed it somehow...i downgraded my php version from 5.1.4 to 4.4.3 again, and that didnt work, so i downgraded to 4.3.1 and that didnt work, so i upgraded back to 5.1.4 and for some reason it just started to work...i really think it's odd but it's fixed, so no worries now...thanks for the replies :D
Post Reply