no offense. I need help on hunchentoot session topic. whether I am doing a very simple mistake, or there is an issue. I do not need do not send your code and beg for help to solicit help as somebody has told days before this is very basically should work as I am expecting. It is very simple. to ensure installs are done:
(ql:quickload '(:hunchentoot)) (hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 5050))
(defun f () (let ((username (hunchentoot:parameter "username"))) (hunchentoot:start-session) (setf (hunchentoot:session-value 'sessu) username) (hunchentoot:session-value 'sessu)))
(push (hunchentoot:create-prefix-dispatcher "/l" 'f) hunchentoot:*dispatch-table*)
(push (hunchentoot:create-static-file-dispatcher-and-handler "/" "/Users/faruk/desktop/page.html") hunchentoot:*dispatch-table*)
and with page.html: <html> <body> <form action="/l" method="get"> <input type="text" name="username" </input> <input type="submit" </input> </form> </body> </html>
2014-03-20 23:08 GMT+02:00 Faruk S. Can farukscan@gmail.com:
no offense. I need help on hunchentoot session topic. whether I am doing a very simple mistake, or there is an issue. I do not need do not send your code and beg for help to solicit help as somebody has told days before this is very basically should work as I am expecting. It is very simple. to ensure installs are done:
(ql:quickload '(:hunchentoot)) (hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 5050))
(defun f () (let ((username (hunchentoot:parameter "username"))) (hunchentoot:start-session) (setf (hunchentoot:session-value 'sessu) username) (hunchentoot:session-value 'sessu)))
(push (hunchentoot:create-prefix-dispatcher "/l" 'f) hunchentoot:*dispatch-table*)
(push (hunchentoot:create-static-file-dispatcher-and-handler "/" "/Users/faruk/desktop/page.html") hunchentoot:*dispatch-table*)
alt console log:
127.0.0.1 - [2014-03-20 23:10:47] "GET / HTTP/1.1" 200 145 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9" [2014-03-20 23:10:51 [ERROR]] (SESSU . hjkl) 127.0.0.1 - [2014-03-20 23:10:51] "GET /l?username=hjkl HTTP/1.1" 500 343 " http://localhost:4040/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
On Thu, Mar 20, 2014 at 11:09 PM, Faruk S. Can farukscan@gmail.com wrote:
and with page.html:
<html> <body> <form action="/l" method="get"> <input type="text" name="username" </input> <input type="submit" </input> </form> </body> </html>
2014-03-20 23:08 GMT+02:00 Faruk S. Can farukscan@gmail.com:
no offense.
I need help on hunchentoot session topic. whether I am doing a very simple mistake, or there is an issue. I do not need do not send your code and beg for help to solicit help as somebody has told days before this is very basically should work as I am expecting. It is very simple. to ensure installs are done:
(ql:quickload '(:hunchentoot)) (hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 5050))
(defun f () (let ((username (hunchentoot:parameter "username"))) (hunchentoot:start-session) (setf (hunchentoot:session-value 'sessu) username) (hunchentoot:session-value 'sessu)))
(push (hunchentoot:create-prefix-dispatcher "/l" 'f) hunchentoot:*dispatch-table*)
(push (hunchentoot:create-static-file-dispatcher-and-handler "/" "/Users/faruk/desktop/page.html") hunchentoot:*dispatch-table*)
On browser: 500 Internal Server Error.
On Thu, Mar 20, 2014 at 11:12 PM, Faruk S. Can farukscan@gmail.com wrote:
alt console log:
127.0.0.1 - [2014-03-20 23:10:47] "GET / HTTP/1.1" 200 145 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9" [2014-03-20 23:10:51 [ERROR]] (SESSU . hjkl) 127.0.0.1 - [2014-03-20 23:10:51] "GET /l?username=hjkl HTTP/1.1" 500 343 " http://localhost:4040/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9"
On Thu, Mar 20, 2014 at 11:09 PM, Faruk S. Can farukscan@gmail.comwrote:
and with page.html:
<html> <body> <form action="/l" method="get"> <input type="text" name="username" </input> <input type="submit" </input> </form> </body> </html>
2014-03-20 23:08 GMT+02:00 Faruk S. Can farukscan@gmail.com:
no offense.
I need help on hunchentoot session topic. whether I am doing a very simple mistake, or there is an issue. I do not need do not send your code and beg for help to solicit help as somebody has told days before this is very basically should work as I am expecting. It is very simple. to ensure installs are done:
(ql:quickload '(:hunchentoot)) (hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 5050))
(defun f () (let ((username (hunchentoot:parameter "username"))) (hunchentoot:start-session) (setf (hunchentoot:session-value 'sessu) username) (hunchentoot:session-value 'sessu)))
(push (hunchentoot:create-prefix-dispatcher "/l" 'f) hunchentoot:*dispatch-table*)
(push (hunchentoot:create-static-file-dispatcher-and-handler "/" "/Users/faruk/desktop/page.html") hunchentoot:*dispatch-table*)
Hello again Faruk, I think the symbol *session* is not bound immediately after calling the function start-session, but the function returns it; this code works:
(defun f () (let ((username (hunchentoot:parameter "username")) (session (hunchentoot:start-session))) (format t "session:~s~%" session) (setf (hunchentoot:session-value 'sessu session) username) (hunchentoot:session-value 'sessu session)))
On Thursday, March 20, 2014 3:29 PM, Faruk S. Can farukscan@gmail.com wrote:
and with page.html: <html> <body> <form action="/l" method="get"> <input type="text" name="username" </input> <input type="submit" </input> </form> </body> </html>
2014-03-20 23:08 GMT+02:00 Faruk S. Can farukscan@gmail.com:
no offense.
I need help on hunchentoot session topic. whether I am doing a very simple mistake, or there is an issue. I do not need do not send your code and beg for help to solicit help as somebody has told days before this is very basically should work as I am expecting. It is very simple. to ensure installs are done:
(ql:quickload '(:hunchentoot))
(hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 5050))
(defun f () (let ((username (hunchentoot:parameter "username"))) (hunchentoot:start-session) (setf (hunchentoot:session-value 'sessu) username) (hunchentoot:session-value 'sessu)))
(push (hunchentoot:create-prefix-dispatcher "/l" 'f) hunchentoot:*dispatch-table*)
(push (hunchentoot:create-static-file-dispatcher-and-handler "/" "/Users/faruk/desktop/page.html") hunchentoot:*dispatch-table*)
Ok, it still reports the error to the browser, but the session is created and the session value is saved.
On , José Ronquillo josrr@ymail.com wrote:
Hello again Faruk, I think the symbol *session* is not bound immediately after calling the function start-session, but the function returns it; this code works:
(defun f () (let ((username (hunchentoot:parameter "username")) (session (hunchentoot:start-session))) (format t "session:~s~%" session) (setf (hunchentoot:session-value 'sessu session) username) (hunchentoot:session-value 'sessu session)))
On Thursday, March 20, 2014 3:29 PM, Faruk S. Can farukscan@gmail.com wrote:
and with page.html: <html> <body> <form action="/l" method="get"> <input type="text" name="username" </input> <input type="submit" </input> </form> </body> </html>
2014-03-20 23:08 GMT+02:00 Faruk S. Can farukscan@gmail.com:
no offense.
I need help on hunchentoot session topic. whether I am doing a very simple mistake, or there is an issue. I do not need do not send your code and beg for help to solicit help as somebody has told days before this is very basically should work as I am expecting. It is very simple. to ensure installs are done:
(ql:quickload '(:hunchentoot))
(hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 5050))
(defun f () (let ((username (hunchentoot:parameter "username"))) (hunchentoot:start-session) (setf (hunchentoot:session-value 'sessu) username) (hunchentoot:session-value 'sessu)))
(push (hunchentoot:create-prefix-dispatcher "/l" 'f) hunchentoot:*dispatch-table*)
(push (hunchentoot:create-static-file-dispatcher-and-handler "/" "/Users/faruk/desktop/page.html") hunchentoot:*dispatch-table*)
Also, i don't understand why session-value does not return the saved string value but generates the "internal error", try this:
(defun f () (let ((username (hunchentoot:parameter "username")) (session (or hunchentoot:*session* (hunchentoot:start-session)))) (if username (setf (hunchentoot:session-value 'sessu session) username)) (format 'nil "session:~a value:~a~%" session (hunchentoot:session-value 'sessu session))))
First send the username: http://127.0.0.1:5050/l?username=jose
after that, get the saved session value http://127.0.0.1:5050/l