<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Upon login it shows the value of (session-value *'username)</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
on the top of the page as desired.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">And when I refresh the page it is still ok.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
But when page is doubled for the second time it is gone</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">and the elements that is programmed to be shown</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">
when (signed-in-p) is nil is shown.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 15, 2014 at 7:42 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">morph composes home-page has changed</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">(defun morph-columns1 ()</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">
(html ()</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (head ()</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (link (list :rel "stylesheet" :href "reset.css"))</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"> (link (list :rel "stylesheet" :href "main.css"))</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (script () +js-sign-in+ +js-logout+ +jswritingdesk+ +jssavewriting+ +jsnotepad+))</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">(body ()</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (morph-categories-axis)</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (morph-time-axis)</div><div class="gmail_default" style="font-family:tahoma,sans-serif">
(div (list :style "height: 45px; border: 1px solid;")</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (morph-name)</div><div class="gmail_default" style="font-family:tahoma,sans-serif">
(morph-search)</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> </div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (div (list :id "online-xor-offline"</div>
<div class="">
<div class="gmail_default" style="font-family:tahoma,sans-serif"> :style "height: 45px; border: 1px solid; float:left;")</div></div><div class="gmail_default" style="font-family:tahoma,sans-serif">
(if (signed-in-p);!!!t</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> </div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (div (list :id "if-online")</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"> (div (list :id "numbers-online" :style "border:1px solid; float:left;") "123 users online")</div><div class="gmail_default" style="font-family:tahoma,sans-serif">
(div (list :id "username" :style "border:1px solid; float:left;") (session-value '*username));!!!"sess val"</div><div class=""><div class="gmail_default" style="font-family:tahoma,sans-serif">
(button (list :onclick "ajaxlogout()") "logout")</div></div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (a (list :onclick "writingdesk()") "writing desk")</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"> (a (list :onclick "notepad()") "note pad")</div><div class="gmail_default" style="font-family:tahoma,sans-serif">
(a (list :onclick "published()") "published")</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (a (list :onclick "preferences()") "preferences"))</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"> </div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (div (list :id "if-offline")</div><div class="gmail_default" style="font-family:tahoma,sans-serif">
(morph-sign-in-form)</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> (morph-signup-link)</div><div class="gmail_default" style="font-family:tahoma,sans-serif">
)))))))</div><div><div class="h5"><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 15, 2014 at 7:40 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">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><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>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>