File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -12,20 +12,24 @@ An OO-PHP class to easily handle sessions
12
12
Include or autoload the XSession.php file, then use as follows..
13
13
14
14
``` php
15
- use solutionstack\XSession
15
+ use solutionstack\XSession;
16
+
16
17
//create A session
17
18
$s = new XSession(string session_name, int session_lifetime_in_secs);
19
+
18
20
//add session data as needed
19
21
$s->put("foo", "bar"):
20
- $->put("user_email", "
[email protected] ");
22
+ $
s ->put("user_email", "
[email protected] ");
21
23
22
24
```
23
25
## In other pages u need to use (check/resume) the session, just do..
24
26
25
27
``` php
26
28
//use the same session name used in starting the session
27
29
$s = new XSession(string session_name);
28
- if($s->resume()) { //session was succesfully resumed
30
+
31
+ if($s->resume()) { //session was succesfully resumed
32
+
29
33
//do stuff for authenticated users
30
34
//also get previously set session values, or set new one
31
35
$email = $s->get("user_email");
@@ -36,9 +40,10 @@ An OO-PHP class to easily handle sessions
36
40
37
41
``` php
38
42
//use the same session name used in starting the session
43
+
39
44
$s = new XSession(string session_name);
40
45
$s->end();
41
- }
46
+
42
47
43
48
```
44
49
### And Thats it.
You can’t perform that action at this time.
0 commit comments