Skip to content

Commit ca549a4

Browse files
committed
Add an explanation of how to avoid headers sent and cookie-based sessions issues
1 parent ea5a54a commit ca549a4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

examples/example_01.php

+13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
* Most other providers work pretty much the same.
66
*/
77

8+
/**
9+
* Step 0: Start PHP session
10+
*
11+
* Normally this step is not required as HybridAuth will attempt to start the session for you, however
12+
* in some cases it might be better to call session_start() at top of script to avoid cookie-based sessions
13+
* issues.
14+
*
15+
* See: http://php.net/manual/en/function.session-start.php#refsect1-function.session-start-notes
16+
* http://stackoverflow.com/a/8028987
17+
*/
18+
19+
session_start();
20+
821
/**
922
* Step 1: Require the Hybridauth Library
1023
*

0 commit comments

Comments
 (0)