1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
+
+
|
;; Copyright 2007-2011, Matthew Welland.
;;
;; This program is made available under the GNU GPL version 2.0 or
;; greater. See the accompanying file COPYING for details.
;;
;; This program is distributed WITHOUT ANY WARRANTY; without even the
;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
;; PURPOSE.
(declare (unit setup))
(declare (uses session))
(require-extension srfi-69)
(require-extension regex)
;;
(define s:session (make-sdat))
(session:initialize s:session)
;; use this for getting data from page to page when scope and evals
;; get in the way
|
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
-
+
-
+
-
+
-
+
-
+
|
(session:link-to s:session page params))
(define (s:get-param key)
(session:get-param s:session key))
;; these are page local
(define (s:get key)
(session:get s:session key))
(session:page-get s:session key))
(define (s:set! key val)
(session:set! s:session key val))
(session:curr-page-set! s:session key val))
(define (s:del! key)
(session:del! s:session key))
(session:page-var-del! s:session key))
(define (s:get-n-del! key)
(let ((val (session:get s:session key)))
(let ((val (session:page-get s:session key)))
(session:del! s:session key)
val))
;; these are session wide
(define (s:session-var-get key)
(session:get s:session "*sessionvars*" key))
(define (s:session-var-set! key val)
(session:set! s:session "*sessionvars*" key val))
(define (s:session-var-get-n-del! key)
(let ((val (session:get s:session key)))
(let ((val (session:page-get s:session key)))
(session:del! s:session "*sessionvars*" key)
val))
(define (s:session-var-del! key)
(session:del! s:session "*sessionvars*" key))
;;
|