Forum Moderators: coopster

Message Too Old, No Replies

sessionID not propogated

         

jackvull

11:30 am on Feb 7, 2006 (gmt 0)

10+ Year Member



Hi
In my PHP.ini I have:
session.use_cookies = 1
session.use_only_cookies = 0
session.use_trans_sid = 0

I have a login script to regenerate the session ID when the user authenticates.

It seems that the sessionID is not being propogated automatically?
I looked at the cookies in Firefox and the cookie still has the old sessionID.
Any ideas?

Thanks.

jackvull

2:17 pm on Feb 7, 2006 (gmt 0)

10+ Year Member



Have tried to do this to overwrite the cookie but no luck either:
setcookie('PHPSESSID', session_id());

jackvull

9:47 am on Feb 8, 2006 (gmt 0)

10+ Year Member



bump

eeek

10:39 pm on Feb 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What are you using to create the session? Do you call session_start()?

jackvull

10:51 pm on Feb 8, 2006 (gmt 0)

10+ Year Member



Yes, I call session_start() on all my pages.
It seems that because I'm using output buffering the cookie never gets overwritten...

I've done some workarounds and passed the sessionID in the URL for the header redirect and made sure that the old cookie is deleted and then replaced with a new one. Seems to work fine after that but it sounds like a bit of overkill to me!

DrDoc

3:24 am on Feb 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I seem to remember reading something about problems with using output buffering and sessions ...
Can't find where now though.