<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">my problem persists. once it has gone but i could not figure out how.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
but now the problem is back.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">any help?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 12, 2014 at 7:19 PM, Faruk S. Can <span dir="ltr"><<a href="mailto:farukscan@gmail.com" target="_blank">farukscan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">hi</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
i cannot sustain a session.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
i login to my app. it shows my login name as i programmed.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">when i refresh the page it stays there.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
but when i refresh for the second time my session name and</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">other things goes away and instead i see what is there for the</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
not loginned case.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">I think i miss something in hunchentoot session hadling.</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">;all html generated by a macro:</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><div class="gmail_default">(defmacro ff (tag)</div><div class="gmail_default"> `(defun ,tag (&rest c)</div><div class="gmail_default">
(with-output-to-string (*standard-output*)</div><div class="gmail_default"> (format t "<~a ~{~a='~a' ~}> ~{~a ~}</~a>" ',tag (car c) (cdr c) ',tag))))</div><div class="gmail_default">
<br></div><div class="gmail_default">;;defining all tag functions:</div><div class="gmail_default"><div class="gmail_default">(progn</div><div class="gmail_default"> (ff html)</div><div class="gmail_default"> (ff title)</div>
<div class="gmail_default"> (ff head)</div><div class="gmail_default"> (ff meta)</div><div class="gmail_default"> (ff link)</div><div class="gmail_default"> (ff style)</div><div class="gmail_default"> (ff script)</div>
<div class="gmail_default"> (ff body)</div><div class="gmail_default"> (ff span)</div><div class="gmail_default"> (ff div)</div><div class="gmail_default"> (ff section)</div><div class="gmail_default"> (ff p)</div><div class="gmail_default">
(ff form)</div><div class="gmail_default"> (ff input)</div><div class="gmail_default"> (ff button)</div><div class="gmail_default"> (ff textarea)</div><div class="gmail_default"> (ff a)</div><div class="gmail_default">
(ff h1)</div><div class="gmail_default"> (ff h2)</div><div class="gmail_default"> (ff h3)</div><div class="gmail_default"> (ff h4)</div><div class="gmail_default"> (ff h5)</div><div class="gmail_default"> (ff h6)</div>
<div class="gmail_default"> (ff ol)</div><div class="gmail_default"> (ff ul)</div><div class="gmail_default"> (ff li))</div><div class="gmail_default"><br></div></div></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
;authentication utilities used by the home page function at the bottom:</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
<div class="gmail_default">(defun signed-in-p ()</div><div class="gmail_default"> (if (and (boundp '*session*) (session-value '*signed-in *session*))</div><div class="gmail_default"> t<span style="white-space:pre-wrap"> </span> </div>
<div class="gmail_default"> nil))</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default">(defun signed-up-p (x y)</div><div class="gmail_default"> (if (with-connection *conn1spec*</div>
<div class="gmail_default"> (query (:select 'username 'password :from 'users.users</div><div class="gmail_default"> :where (:and (:= 'username x)</div><div class="gmail_default">
(:= 'password y)))))</div><div class="gmail_default"> t</div><div class="gmail_default"> nil))</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default">
(defun sign-in ()</div><div class="gmail_default"> (let ((username (parameter "username"))</div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>(password (parameter "password")))</div>
<div class="gmail_default"> (if (signed-up-p username password)</div><div class="gmail_default"> (progn</div><div class="gmail_default"> (start-session)</div><div class="gmail_default"> (setf (session-value '*username) username)</div>
<div class="gmail_default"> (setf (session-value '*signed-in) t)</div><div class="gmail_default"> (morph-status-plate (session-value '*username)))</div><div class="gmail_default"> (with-output-to-string (s)</div>
<div class="gmail_default"> (princ (morph-sign-in-form) s)</div><div class="gmail_default"> (princ "No record found!" s)</div><div class="gmail_default"> (princ (a (list :href "/form-sign-up") "Sign up") s)</div>
<div class="gmail_default"> ))))</div><div class="gmail_default">;the data base querying functions are working correctly</div><div class="gmail_default">;views generated:</div><div class="gmail_default"><br></div>
<div class="gmail_default"><div class="gmail_default">(defun morph-write-button ()</div><div class="gmail_default"> (div (list :style "border:1px solid; float:left;")</div><div class="gmail_default"> (a (list :href "/writingp") "write")))</div>
<div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default">(defun morph-status-plate (username)</div><div class="gmail_default"> (div (list :id "status-plate" :style "border:1px solid; float:left;")</div>
<div class="gmail_default"> (span () "123 users online")</div><div class="gmail_default"> (span () username)</div><div class="gmail_default"> (button (list :onclick "ajaxlogout()") "logout")))</div>
<div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default">(defun morph-sign-in-form ()</div><div class="gmail_default"> (div (list :id "sign-in-form" :style "border:1px solid; float:left;")</div>
<div class="gmail_default"> (form (list :method "" :action "")</div><div class="gmail_default"> (input (list :id "username" :type "input" :name "username"))</div><div class="gmail_default">
(input (list :id "password" :type "input" :name "password"))</div><div class="gmail_default"> (input (list :onClick "ajaxsignin()" :type "button" :value "login")))))</div>
<div class="gmail_default"><br></div></div></div><div class="gmail_default">;at last</div></div></div></div></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">;the page i generate as home page:</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><div class="gmail_default">(div (list :id "sign-in-form-or-status-plate"</div><div class="gmail_default"> :style "height: 45px; border: 1px solid; float:left;")</div>
<div class="gmail_default"> (if (signed-in-p);;;;;;</div><div class="gmail_default"> (with-output-to-string (s)</div><div class="gmail_default"> (start-session)</div><div class="gmail_default">
(princ (morph-status-plate (session-value '*username)) s)</div><div class="gmail_default"> (princ (morph-write-button) s))</div><div class="gmail_default"> (with-output-to-string (s)</div>
<div class="gmail_default"> (princ (morph-sign-in-form) s)</div><div class="gmail_default"> (princ (a (list :href "form-sign-up") "Sign up") s))))</div></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div></div>
</blockquote></div><br></div>