Michal wrote: > Hi, > > I've setup Facebook Connect on my site so people can login using their > Facebook details. This includes a PHP library, methods of which I call > in my user class to determine logged-in status of the user. It > *usually* works. However, I do occasionally get errors: > > Notice: Uninitialized string offset: 0 (the line specified is when I > try to access data retrieved by the Facebook PHP library) > > Warning: Cannot modify header information - headers already sent by > (the line specified is part of the Facebook library, where is calls > "setCookie") > > I wonder, could these be something do to with "bypassing" various > Agavi input / output with regards to cookies? If so, how can this be > avoided? If no, does anyone have any ideas as to why these errors > occur? > > Michal. > Hello, Michal!
Not knowing anything about Facebook Connect this is a shot in the dark, but I'd assume what happens is that the FB Connect thing fails to retrieve data for some reason or the other, but you proceed to use the data, causing PHP to emit a Notice. If you don't have display_errors off or error_reporting set to an appropriate level, the notice will be sent to the browser. When that happens, it also has to send HTTP headers. setCookie also uses headers to set the cookie, but as the headers have already been sent, it (surprisingly enough) cannot send any more headers. What you want to do is to check that you actually have retrieved data before accessing it. Hope this helps at least a bit, Markus _______________________________________________ users mailing list [email protected] http://lists.agavi.org/mailman/listinfo/users
