Re: Session started and cookie set, but no vars added

0 views
Skip to first unread message

Steve Piercy - Website Builder

unread,
Jul 4, 2015, 3:14:12 PM7/4/15
to knop-p...@googlegroups.com
Cross-posting from LassoTalk for the Knop list archive. To see
the message in context:
http://lasso.2283332.n4.nabble.com/Session-started-and-cookie-set-but-no-vars-added-tt4643867.html


On 7/3/15 at 12:01 PM, W...@StevePiercy.com (Steve Piercy -
Website Builder) pronounced:

>I still have a couple of other tests to try:
>* Take the $s_user object and attempt to serialize it in the page.

I found the problem. It was actually not the knop_user type
itself, but how I defined the knop_database object, which is
used in knop_user. (Thanks again for the sanity check, Jolle!)

Here's where I went sideways. I tried a new connection method
for knop_database for this one website, and it completely
slipped my mind I had done so because everything else was
working. My motivation was to use the faster -host connection
method in order to bypass Lasso Admin's database checking.

This code will return an error when knop_database is defined
using the unsupported method.

var(db) = knop_database(
-host=cnxn -> host -> asarray, // <- don't do this
-database=cnxn -> database,
-table=cnxn -> table,
-maxrecords=$maxrecords,
-keyfield='keyfield',
)

var(s_user) = knop_user(
-userdb=$db,
-userfield='username',
-passwordfield='password',
-encrypt=$encrypt_method,
-saltfield='saltfield',
-cost=false,
)

<textarea rows="80" cols="160">
[$s_user -> serialize]
</textarea>
=>
Error Code: -9945
Error Msg: The type keyword was not serializable

This will work when you have also provided a connection to the
database in Lasso Admin.

var(db) = knop_database(
-database=cnxn -> database,
-table=cnxn -> table,
-maxrecords=$maxrecords,
-keyfield='keyfield',
)

=>
Lots of serialized output.

(Thanks to Steffan and Kyle for the clues toward serialization
issues, and Maxwell Klein for pointing me to look in the Lasso
Admin sessions database.)

Furthermore, there is an issue in Knop for Lasso 9, which is
likely a carryover from the conversion from Lasso 8. In the
knop_database type, its oncreate method has three signatures,
one of which is defined as follows.

oncreate(-database::string, -table::string, -host::array
=?, -username::string =?, -password::string =?,
-keyfield::string =?, -lockfield::string =?, -user =?,
-validate::boolean =?)

-host::array is bad because it cannot be serialized up the
chain. It should be -host::staticarray for Lasso 9.

>* Take the gist from before and "Knoppify" it.

FTR, this worked.

>* Dive in deep into knop_user and possibly further into
>knop_database to see whether the datasource, MySQL vs.
>FileMaker, has anything to do with it. The working website
>uses FileMaker, but the busted one uses MySQL.

In the short term, I might convert the -host argument to a
staticarray type and see if that's possible.

My plan with long term Knop for Lasso 9 development (when I get
a spare moment, ha), is to decouple the knop_database type from
all other knop_* types, allowing the use of [ds] and any other
datasource, including session data, to improve performance. Now
if only there were a generous client who would fund open source
development for doing this work...

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy Website Builder Soquel, CA
<w...@StevePiercy.com> <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
the mailing list Lasso La...@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-un...@lists.lassosoft.com>
Send administrative queries to <Lasso-...@lists.lassosoft.com>

Reply all
Reply to author
Forward
0 new messages