Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session_start(); Notice #38

Open
s4shi87 opened this issue Jan 12, 2016 · 2 comments
Open

session_start(); Notice #38

s4shi87 opened this issue Jan 12, 2016 · 2 comments

Comments

@s4shi87
Copy link

s4shi87 commented Jan 12, 2016

Wenn das Projekt schon die Session per session_start(); gestartet hat, dann kommt eine Notice Meldung, weil in /Immobilienscout/Rest.php in Zeile 2 die Session erneut gestartet wird.

Notice: A session had already been started - ignoring session_start()
in vendor/immocaster/php-sdk/Immocaster/Immobilienscout/Rest.php at line 2

Es ist zwar nur eine Notice, aber bitte beheben ... oder ein Workaround vorschlagen :)

@apfelbox
Copy link

apfelbox commented Sep 5, 2016

This makes it impossible to use this API with any existing framework, as they do their own session management, which breaks if this library just globally starts the session.

@jan-koch
Copy link

jan-koch commented Sep 8, 2016

There might be a way to integrate this with WordPress.

I think this code snippet helps:
function register_session(){ if( !session_id() ) session_start(); } add_action('init','register_session');

Just tested it in a flat WP installation where I integrated this API as a plugin. With this code in the main plugin file, I don't get any "headers already sent" messages and the API returns region data, all properties for an account, and the other demo function calls seem to work as well.

Without the snippet I do get the warnings - API works too though.

Not sure how this affects compatibility to other plugins with session handling!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants