Skip to content

Commit 500d8e5

Browse files
committed
still testing ci
1 parent 584e867 commit 500d8e5

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,50 @@
44

55
# XSession
66
An OO-PHP class to easily handle sessions
7+
8+
## Usage
9+
Include or autoload the XSession.php file, then use as follows..
10+
11+
```php
12+
use solutionstack\XSession
13+
//create A session
14+
$s = new XSession(string session_name, int session_lifetime_in_secs);
15+
//add session data as needed
16+
$s->put("foo", "bar"):
17+
$->put("user_email", "[email protected]");
18+
19+
```
20+
## In other pages u need to use (check/resume) the session, just do..
21+
22+
```php
23+
//use the same session name used in starting the session
24+
$s = new XSession(string session_name);
25+
if($s->resume()) { //session was succesfully resumed
26+
//do stuff for authenticated users
27+
//also get previously set session values, or set new one
28+
$email = $s->get("user_email");
29+
}
30+
31+
```
32+
## When done with the session, say in your logout routine,..
33+
34+
```php
35+
//use the same session name used in starting the session
36+
$s = new XSession(string session_name);
37+
$s->end();
38+
}
39+
40+
```
41+
### And Thats it.
42+
43+
### XSession uses ideas from the following project [SecureSessionHandler]
44+
See https://gist.github.com/eddmann/10262795
45+
46+
License
47+
----
48+
49+
MIT
50+
51+
52+
**Free Software, Hell Yeah!**
53+

0 commit comments

Comments
 (0)