|
@@ -1,7 +1,5 @@
|
1
|
1
|
# -*- coding: utf-8 -*-
|
2
|
2
|
|
3
|
|
-"""
|
4
|
|
-from lodel.auth.exceptions import AuthenticationError
|
5
|
3
|
from lodel.plugin import LodelHook
|
6
|
4
|
|
7
|
5
|
from .filesystem_session_store import FileSystemSession
|
|
@@ -10,33 +8,37 @@ from .filesystem_session_store import FileSystemSession
|
10
|
8
|
# @param caller *
|
11
|
9
|
# @param payload dict
|
12
|
10
|
# @return str
|
13
|
|
-@LodelHook('session_start')
|
14
|
|
-def start_session(caller, payload):
|
15
|
|
- new_session = FileSystemSession(content=payload)
|
|
11
|
+def start_session():
|
|
12
|
+ new_session = FileSystemSession()
|
16
|
13
|
return new_session.sid
|
17
|
14
|
|
18
|
|
-'''
|
19
|
15
|
## @brief destroys a session
|
20
|
16
|
# @param caller *
|
21
|
17
|
# @param sid str : session id
|
22
|
|
-@LodelHook('session_destroy')
|
23
|
|
-def stop_session(caller, sid):
|
|
18
|
+def destroy_session(sid):
|
24
|
19
|
FileSystemSession.destroy(sid)
|
25
|
|
-'''
|
26
|
20
|
|
27
|
21
|
## @brief reads a session content
|
28
|
22
|
# @param caller *
|
29
|
23
|
# @param sid str: session id
|
30
|
24
|
# @return FileSystemSession
|
31
|
|
-@LodelHook('session_load')
|
32
|
|
-def read_session(caller, sid):
|
|
25
|
+def restore_session(sid):
|
33
|
26
|
return FileSystemSession.load(sid)
|
34
|
27
|
|
35
|
|
-'''
|
36
|
|
-## @brief destroys all the old sessions (expired ones)
|
37
|
|
-# @param caller *
|
38
|
|
-@LodelHook('session_clean')
|
39
|
|
-def clean_sessions(caller):
|
40
|
|
- FileSystemSession.clean()
|
41
|
|
-'''
|
42
|
|
-"""
|
|
28
|
+##@brief Set a session value
|
|
29
|
+#@param name str : session variable name
|
|
30
|
+#@param value mixed : session variable value
|
|
31
|
+def set_value(name, value):
|
|
32
|
+ pass
|
|
33
|
+
|
|
34
|
+##@brief Get a session value
|
|
35
|
+#@param name str : the session variable name
|
|
36
|
+#@return the value
|
|
37
|
+def get_value(name):
|
|
38
|
+ pass
|
|
39
|
+
|
|
40
|
+##@brief Delete a session value
|
|
41
|
+#@param name str : the session variable name
|
|
42
|
+def del_value(name):
|
|
43
|
+ pass
|
|
44
|
+
|