| From: Tami Williams | Date Sent: 2010-07-31 20:02:46 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
You can download a test page that shows the problem at http://www.asktami.com/download/Session.zip
Then load the page at
http://YourLP9IP/Session.lasso?action=p1
First time it runs this line is uncommented and everything works:
$IndexLinks->Insert(map('x' = 'y'));
Then comment out this line:
// $IndexLinks->Insert(map('x' = 'y'));
and uncomment these lines and click through the pages and you'll see
the problem:
$IndexLinks->Insert(map('a' = 'b'));
$IndexLinks->Insert(map('c' = 'd'));
On Jul 31, 2010, at 7:16 PM, Steve Piercy - Web Site Builder wrote:
> "I see dead colons."
>
> Also we're missing the context of how these variables are stored in
> a session and how the session is started and persists. IOW, the
> complete code sample required to replicate and therefore better
> understand the issue is not present.
>
> --steve
>
>
> On 7/31/10 at 6:54 PM, tami@[Protected] (Tami Williams) pronounced:
>
>> CODE WITHOUT COLONS below - no change in how it runs.
>>
>>
>> OK, I'm getting closer and hope someone can help me.
>>
>> I have a session var call IndexLinks. Its an array. For testing
>> purposes (to debug this) I'm setting it to be an empty array, then
>> doing a conditional check to fill it with elements. Then I click
>> on pages in the site to see if the session var now shows the new
>> elements on all pages in the site.
>>
>> The problem is if I do multiple inserts - the session var doesn't
>> get updated.
>> A single insert works, multiple inserts (like from records in an
>> inline search of a db) do not work.
>>
>> Note: I'm displaying the session var on my site pages like this:
>> <hr>
>> <br>IndexLinks is <b>[string(var('IndexLinks'))]</b>
>>
>>
>>
>> THIS WORKS:
>> (Step 1)
>> var('IndexLinks') = array();
>>
>> if((var:'IndexLinks')->type != 'array' || (var:'IndexLinks')->size
>> == 0);
>> var('IndexLinks') = array();
>> $IndexLinks->Insert(map('x' = 'y'));
>>
>> /if;
>>
>> On the 1st page, AND all subsequent pages, I see:
>> IndexLinks is array(map(x = y))
>>
>>
>>
>> THIS DOES NOT WORK:
>>
>> IF I do Step 1 above then this (Step 2):
>>
>> var('IndexLinks') = array();
>>
>> if((var:'IndexLinks')->type != 'array' || (var:'IndexLinks')->size
>> == 0);
>> var('IndexLinks') = array();
>>
>> $IndexLinks->Insert(map('a' = 'b'));
>> $IndexLinks->Insert(map('c' = 'd'));
>>
>> /if;
>>
>> On the 1st page, I see:
>> IndexLinks is array(map(a = b), map(c = d)) // this is right
>>
>> but on all other pages it shows as the old session var:
>> IndexLinks is array(map(x = y)) // this is wrong
>>
>> Any ideas?
>>
>> And again, thanks in advance.
>>
>>
>> I think the Assignment and References change in Lasso 9 might be
>> the problem but right now I can't see how to fix this.
>>
>>
>>
>> --
>>
>>
>>
>> --
>>
>>
>>
>>
>> --
>>
>>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy Web Site Builder Soquel, CA
> <web@[Protected]> <http://www.StevePiercy.com/>
| From: Tim Taplin | Date Sent: 2010-07-31 20:42:54 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
hmm, it looks like there is an issue with storing the map type inside the array when serialized into the session.
If I replace the insert map lines with insert pair, it works as expected. So this looks like there may be some issue with map serialization. Need to try to determine scope of the issue and see if we can get it fixed. perhaps someone else can confirm or better explain this issue.
Tim
On Jul 31, 2010, at 9:02 PM, Tami Williams wrote:
>
>
> You can download a test page that shows the problem at http://www.asktami.com/download/Session.zip
>
>
> Then load the page at
> http://YourLP9IP/Session.lasso?action=p1
>
>
> First time it runs this line is uncommented and everything works:
> $IndexLinks->Insert(map('x' = 'y'));
>
> Then comment out this line:
> // $IndexLinks->Insert(map('x' = 'y'));
>
> and uncomment these lines and click through the pages and you'll see the problem:
> $IndexLinks->Insert(map('a' = 'b'));
> $IndexLinks->Insert(map('c' = 'd'));
>
>
>
> On Jul 31, 2010, at 7:16 PM, Steve Piercy - Web Site Builder wrote:
>
>> "I see dead colons."
>>
>> Also we're missing the context of how these variables are stored in a session and how the session is started and persists. IOW, the complete code sample required to replicate and therefore better understand the issue is not present.
>>
>> --steve
>>
>>
>> On 7/31/10 at 6:54 PM, tami@[Protected] (Tami Williams) pronounced:
>>
>>> CODE WITHOUT COLONS below - no change in how it runs.
>>>
>>>
>>> OK, I'm getting closer and hope someone can help me.
>>>
>>> I have a session var call IndexLinks. Its an array. For testing purposes (to debug this) I'm setting it to be an empty array, then doing a conditional check to fill it with elements. Then I click on pages in the site to see if the session var now shows the new elements on all pages in the site.
>>>
>>> The problem is if I do multiple inserts - the session var doesn't get updated.
>>> A single insert works, multiple inserts (like from records in an inline search of a db) do not work.
>>>
>>> Note: I'm displaying the session var on my site pages like this:
>>> <hr>
>>> <br>IndexLinks is <b>[string(var('IndexLinks'))]</b>
>>>
>>>
>>>
>>> THIS WORKS:
>>> (Step 1)
>>> var('IndexLinks') = array();
>>>
>>> if((var:'IndexLinks')->type != 'array' || (var:'IndexLinks')->size == 0);
>>> var('IndexLinks') = array();
>>> $IndexLinks->Insert(map('x' = 'y'));
>>>
>>> /if;
>>>
>>> On the 1st page, AND all subsequent pages, I see:
>>> IndexLinks is array(map(x = y))
>>>
>>>
>>>
>>> THIS DOES NOT WORK:
>>>
>>> IF I do Step 1 above then this (Step 2):
>>>
>>> var('IndexLinks') = array();
>>>
>>> if((var:'IndexLinks')->type != 'array' || (var:'IndexLinks')->size == 0);
>>> var('IndexLinks') = array();
>>>
>>> $IndexLinks->Insert(map('a' = 'b'));
>>> $IndexLinks->Insert(map('c' = 'd'));
>>>
>>> /if;
>>>
>>> On the 1st page, I see:
>>> IndexLinks is array(map(a = b), map(c = d)) // this is right
>>>
>>> but on all other pages it shows as the old session var:
>>> IndexLinks is array(map(x = y)) // this is wrong
>>>
>>> Any ideas?
>>>
>>> And again, thanks in advance.
>>>
>>>
>>> I think the Assignment and References change in Lasso 9 might be the problem but right now I can't see how to fix this.
>>>
>>>
>>>
>>> --
>>>
>>>
>>>
>>> --
>>>
>>>
>>>
>>>
>>> --
>>>
>>>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy Web Site Builder Soquel, CA
>> <web@[Protected]> <http://www.StevePiercy.com/>
| From: Steve Piercy - Web Site Builder | Date Sent: 2010-08-01 01:52:59 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
OK, I grabbed the .zip and it is borked.
First, you don't need to do this on every page:
Session_Start('TestSessionX', -Expires=15, -UseLink);
Session_AddVar('TestSessionX', 'testSessionVar');
You need to do that only once, then on each subsequent page:
Session_Start('TestSessionX', -Expires=15, -UseLink);
Once the variable has been added to the session, it stays there
until removed or the session ends.
Second, on the first page load *ever*, nothing happens within
your select statement, and the variable testSessionVar is
initialized as null.
=>
testSessionVar IS defined and is // it was actually
initialized as null
this Session ID = // it was started but does not show up on
the first page load, only on subsequent page loads
session_result = new IndexLinks does not exist
testSessionVar exists
Upon reload, nothing happens still because you are selecting on
action_param('action') which has no value.
I cannot determine your intent of what function you want your
code to perform. Suggest taking a look at the session example I
posted on the wiki previously and tweaking it to do what you
would like. Or take a look at the "official" example from the
Language Guide (what had been posted to the wiki was messed up,
but I fixed it last night).
http://lassosoft.wiki.zoho.com/Debugging-and-Troubleshooting.html#Interpreting_the_Lasso_9_Error_Stack
http://lassosoft.wiki.zoho.com/Sessions.html#SessionExamplemetathisselfcontainedexampleillustrateshowtousesessionstostoresitepreferencesmeta
--steve
On 7/31/10 at 11:02 PM, tami@[Protected] (Tami Williams) pronounced:
>
>You can download a test page that shows the problem at http://www.asktami.com/download/Session.zip
>
>
>Then load the page at
>http://YourLP9IP/Session.lasso?action=p1
>
>
>First time it runs this line is uncommented and everything works:
>$IndexLinks->Insert(map('x' = 'y'));
>
>Then comment out this line:
>// $IndexLinks->Insert(map('x' = 'y'));
>
>and uncomment these lines and click through the pages and you'll see the problem:
>$IndexLinks->Insert(map('a' = 'b'));
>$IndexLinks->Insert(map('c' = 'd'));
>
>
>
>On Jul 31, 2010, at 7:16 PM, Steve Piercy - Web Site Builder wrote:
>
>>"I see dead colons."
>>
>>Also we're missing the context of how these variables are
>>stored in a session and how the session is started and
>>persists. IOW, the complete code sample required to replicate
>>and therefore better understand the issue is not present.
>>
>>--steve
>>
>>
>>On 7/31/10 at 6:54 PM, tami@[Protected] (Tami Williams) pronounced:
>>
>>>CODE WITHOUT COLONS below - no change in how it runs.
>>>
>>>
>>>OK, I'm getting closer and hope someone can help me.
>>>
>>>I have a session var call IndexLinks. Its an array. For
>>>testing purposes (to debug this) I'm setting it to be an
>>>empty array, then doing a conditional check to fill it with
>>>elements. Then I click on pages in the site to see if the
>>>session var now shows the new elements on all pages in the site.
>>>
>>>The problem is if I do multiple inserts - the session var
>>>doesn't get updated.
>>>A single insert works, multiple inserts (like from records in
>>>an inline search of a db) do not work.
>>>
>>>Note: I'm displaying the session var on my site pages like this:
>>><hr>
>>><br>IndexLinks is <b>[string(var('IndexLinks'))]</b>
>>>
>>>
>>>
>>>THIS WORKS:
>>>(Step 1)
>>>var('IndexLinks') = array();
>>>
>>>if((var:'IndexLinks')->type != 'array' ||
>>>(var:'IndexLinks')->size == 0);
>>>var('IndexLinks') = array();
>>>$IndexLinks->Insert(map('x' = 'y'));
>>>
>>>/if;
>>>
>>>On the 1st page, AND all subsequent pages, I see:
>>>IndexLinks is array(map(x = y))
>>>
>>>
>>>
>>>THIS DOES NOT WORK:
>>>
>>>IF I do Step 1 above then this (Step 2):
>>>
>>>var('IndexLinks') = array();
>>>
>>>if((var:'IndexLinks')->type != 'array' ||
>>>(var:'IndexLinks')->size == 0);
>>>var('IndexLinks') = array();
>>>
>>>$IndexLinks->Insert(map('a' = 'b'));
>>>$IndexLinks->Insert(map('c' = 'd'));
>>>
>>>/if;
>>>
>>>On the 1st page, I see:
>>>IndexLinks is array(map(a = b), map(c = d)) // this is right
>>>
>>>but on all other pages it shows as the old session var:
>>>IndexLinks is array(map(x = y)) // this is wrong
>>>
>>>Any ideas?
>>>
>>>And again, thanks in advance.
>>>
>>>
>>>I think the Assignment and References change in Lasso 9 might
>>>be the problem but right now I can't see how to fix this.
>>>
>>>
>>>
>>>--
>>>
>>>
>>>
>>>--
>>>
>>>
>>>
>>>
>>>--
>>>
>>>
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy Web Site Builder Soquel, CA
>><web@[Protected]> <http://www.StevePiercy.com/>
>>
>>
>>--
>>
>>
>
>
>--
>
>
>
>
>--
>
>
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy Web Site Builder
Soquel, CA
<web@[Protected]> <http://www.StevePiercy.com/>
| From: Steve Piercy - Web Site Builder | Date Sent: 2010-08-01 03:00:45 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
Duh, OK, use the parameter action=p1.
So in 8.5, IndexLinks is always:
array: (map: (x)=(y)), (map: (a)=(b)), (map: (c)=(d))
But in 9:
p1 only:
array(map(x = y), map(a = b), map(c = d))
p2 and p3:
array()
Using my example, I can replicate the problem in a similar manner.
http://lassosoft.wiki.zoho.com/Debugging-and-Troubleshooting.html#Interpreting_the_Lasso_9_Error_Stack
Strings, arrays and pairs can be added inserted into the array
variable and appear in the session without problem. However
when inserting a map element into the array variable, it appears
on the array, but not in the session.
$fruit->insert(action_param('fruit')); // strings work
$fruit->insert($fruit->size = action_param('fruit')); //
pairs work
$fruit->insert(array($fruit->size, action_param('fruit')));
// arrays work
$fruit->insert(map($fruit->size = action_param('fruit')));
// maps fail
I don't know how to fix it. It could be a bug. Suggest sending
it bugs@[Protected] or posting to the lasso9beta list.
--steve
On 8/1/10 at 1:52 AM, Web@[Protected] (Steve Piercy - Web
Site Builder) pronounced:
>OK, I grabbed the .zip and it is borked.
>
>First, you don't need to do this on every page:
>
>Session_Start('TestSessionX', -Expires=15, -UseLink);
>Session_AddVar('TestSessionX', 'testSessionVar');
>
>You need to do that only once, then on each subsequent page:
>
>Session_Start('TestSessionX', -Expires=15, -UseLink);
>
>Once the variable has been added to the session, it stays there
>until removed or the session ends.
>
>Second, on the first page load *ever*, nothing happens within
>your select statement, and the variable testSessionVar is
>initialized as null.
>
>=>
>testSessionVar IS defined and is // it was actually initialized as null
>this Session ID = // it was started but does not show up on the
>first page load, only on subsequent page loads
>session_result = new IndexLinks does not exist
>testSessionVar exists
>
>Upon reload, nothing happens still because you are selecting on
>action_param('action') which has no value.
>
>I cannot determine your intent of what function you want your
>code to perform. Suggest taking a look at the session example
>I posted on the wiki previously and tweaking it to do what you
>would like. Or take a look at the "official" example from the
>Language Guide (what had been posted to the wiki was messed up,
>but I fixed it last night).
>
>http://lassosoft.wiki.zoho.com/Debugging-and-Troubleshooting.html#
>Interpreting_the_Lasso_9_Error_Stack
>
>http://lassosoft.wiki.zoho.com/Sessions.html#
>SessionExamplemetathisselfcontainedexampleillustrateshowtousesessionstostoresiteprefe
>rencesmeta
>
>--steve
>
>
>On 7/31/10 at 11:02 PM, tami@[Protected] (Tami Williams) pronounced:
>
>>
>>You can download a test page that shows the problem at
>http://www.asktami.com/download/Session.zip
>>
>>
>>Then load the page at
>>http://YourLP9IP/Session.lasso?action=p1
>>
>>
>>First time it runs this line is uncommented and everything works:
>>$IndexLinks->Insert(map('x' = 'y'));
>>
>>Then comment out this line:
>>// $IndexLinks->Insert(map('x' = 'y'));
>>
>>and uncomment these lines and click through the pages and you'll see the problem:
>>$IndexLinks->Insert(map('a' = 'b'));
>>$IndexLinks->Insert(map('c' = 'd'));
>>
>>
>>
>>On Jul 31, 2010, at 7:16 PM, Steve Piercy - Web Site Builder wrote:
>>
>>>"I see dead colons."
>>>
>>>Also we're missing the context of how these variables are
>>>stored in a session and how the session is started and
>>>persists. IOW, the complete code sample required to
>>>replicate and therefore better understand the issue is not present.
>>>
>>>--steve
>>>
>>>
>>>On 7/31/10 at 6:54 PM, tami@[Protected] (Tami Williams) pronounced:
>>>
>>>>CODE WITHOUT COLONS below - no change in how it runs.
>>>>
>>>>
>>>>OK, I'm getting closer and hope someone can help me.
>>>>
>>>>I have a session var call IndexLinks. Its an array. For
>>>>testing purposes (to debug this) I'm setting it to be an
>>>>empty array, then doing a conditional check to fill it with
>>>>elements. Then I click on pages in the site to see if the
>>>>session var now shows the new elements on all pages in the site.
>>>>
>>>>The problem is if I do multiple inserts - the session var
>>>>doesn't get updated.
>>>>A single insert works, multiple inserts (like from records
>>>>in an inline search of a db) do not work.
>>>>
>>>>Note: I'm displaying the session var on my site pages like this:
>>>><hr>
>>>><br>IndexLinks is <b>[string(var('IndexLinks'))]</b>
>>>>
>>>>
>>>>
>>>>THIS WORKS:
>>>>(Step 1)
>>>>var('IndexLinks') = array();
>>>>
>>>>if((var:'IndexLinks')->type != 'array' ||
>>>>(var:'IndexLinks')->size == 0);
>>>>var('IndexLinks') = array();
>>>>$IndexLinks->Insert(map('x' = 'y'));
>>>>
>>>>/if;
>>>>
>>>>On the 1st page, AND all subsequent pages, I see:
>>>>IndexLinks is array(map(x = y))
>>>>
>>>>
>>>>
>>>>THIS DOES NOT WORK:
>>>>
>>>>IF I do Step 1 above then this (Step 2):
>>>>
>>>>var('IndexLinks') = array();
>>>>
>>>>if((var:'IndexLinks')->type != 'array' ||
>>>>(var:'IndexLinks')->size == 0);
>>>>var('IndexLinks') = array();
>>>>
>>>>$IndexLinks->Insert(map('a' = 'b'));
>>>>$IndexLinks->Insert(map('c' = 'd'));
>>>>
>>>>/if;
>>>>
>>>>On the 1st page, I see:
>>>>IndexLinks is array(map(a = b), map(c = d)) // this is right
>>>>
>>>>but on all other pages it shows as the old session var:
>>>>IndexLinks is array(map(x = y)) // this is wrong
>>>>
>>>>Any ideas?
>>>>
>>>>And again, thanks in advance.
>>>>
>>>>
>>>>I think the Assignment and References change in Lasso 9
>>>>might be the problem but right now I can't see how to fix this.
>>>>
>>>>
>>>>
>>>>--
>>>>
>>>>
>>>>
>>>>--
>>>>
>>>>
>>>>
>>>>
>>>>--
>>>>
>>>>
>>>
>>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>Steve Piercy Web Site Builder Soquel, CA
>>><web@[Protected]> <http://www.StevePiercy.com/>
>>>
>>>
>>>--
>>>
>>>
>>
>>
>>--
>>
>>
>>
>>
>>--
>>
>>
>
>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>Steve Piercy Web Site Builder Soquel, CA
><web@[Protected]> <http://www.StevePiercy.com/>
>
>
>--
>
>
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy Web Site Builder
Soquel, CA
<web@[Protected]> <http://www.StevePiercy.com/>
| From: Tami Williams | Date Sent: 2010-08-01 03:43:47 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
So, storing the map type inside the array when serialized into the
session works when the map just has 1 pair. If the map has more than
1 pair, storing the map type inside the array when serialized into the
session doesn't work.
On Jul 31, 2010, at 11:42 PM, Tim Taplin wrote:
> hmm, it looks like there is an issue with storing the map type
> inside the array when serialized into the session.
>
> If I replace the insert map lines with insert pair, it works as
> expected. So this looks like there may be some issue with map
> serialization. Need to try to determine scope of the issue and see
> if we can get it fixed. perhaps someone else can confirm or better
> explain this issue.
>
> Tim
>
> On Jul 31, 2010, at 9:02 PM, Tami Williams wrote:
>
>>
>>
>> You can download a test page that shows the problem at http://www.asktami.com/download/Session.zip
>>
>>
>> Then load the page at
>> http://YourLP9IP/Session.lasso?action=p1
>>
>>
>> First time it runs this line is uncommented and everything works:
>> $IndexLinks->Insert(map('x' = 'y'));
>>
>> Then comment out this line:
>> // $IndexLinks->Insert(map('x' = 'y'));
>>
>> and uncomment these lines and click through the pages and you'll
>> see the problem:
>> $IndexLinks->Insert(map('a' = 'b'));
>> $IndexLinks->Insert(map('c' = 'd'));
>>
>>
>>
>> On Jul 31, 2010, at 7:16 PM, Steve Piercy - Web Site Builder wrote:
>>
>>> "I see dead colons."
>>>
>>> Also we're missing the context of how these variables are stored
>>> in a session and how the session is started and persists. IOW,
>>> the complete code sample required to replicate and therefore
>>> better understand the issue is not present.
>>>
>>> --steve
>>>
>>>
>>> On 7/31/10 at 6:54 PM, tami@[Protected] (Tami Williams) pronounced:
>>>
>>>> CODE WITHOUT COLONS below - no change in how it runs.
>>>>
>>>>
>>>> OK, I'm getting closer and hope someone can help me.
>>>>
>>>> I have a session var call IndexLinks. Its an array. For testing
>>>> purposes (to debug this) I'm setting it to be an empty array,
>>>> then doing a conditional check to fill it with elements. Then I
>>>> click on pages in the site to see if the session var now shows
>>>> the new elements on all pages in the site.
>>>>
>>>> The problem is if I do multiple inserts - the session var doesn't
>>>> get updated.
>>>> A single insert works, multiple inserts (like from records in an
>>>> inline search of a db) do not work.
>>>>
>>>> Note: I'm displaying the session var on my site pages like this:
>>>> <hr>
>>>> <br>IndexLinks is <b>[string(var('IndexLinks'))]</b>
>>>>
>>>>
>>>>
>>>> THIS WORKS:
>>>> (Step 1)
>>>> var('IndexLinks') = array();
>>>>
>>>> if((var:'IndexLinks')->type != 'array' || (var:'IndexLinks')-
>>>> >size == 0);
>>>> var('IndexLinks') = array();
>>>> $IndexLinks->Insert(map('x' = 'y'));
>>>>
>>>> /if;
>>>>
>>>> On the 1st page, AND all subsequent pages, I see:
>>>> IndexLinks is array(map(x = y))
>>>>
>>>>
>>>>
>>>> THIS DOES NOT WORK:
>>>>
>>>> IF I do Step 1 above then this (Step 2):
>>>>
>>>> var('IndexLinks') = array();
>>>>
>>>> if((var:'IndexLinks')->type != 'array' || (var:'IndexLinks')-
>>>> >size == 0);
>>>> var('IndexLinks') = array();
>>>>
>>>> $IndexLinks->Insert(map('a' = 'b'));
>>>> $IndexLinks->Insert(map('c' = 'd'));
>>>>
>>>> /if;
>>>>
>>>> On the 1st page, I see:
>>>> IndexLinks is array(map(a = b), map(c = d)) // this is right
>>>>
>>>> but on all other pages it shows as the old session var:
>>>> IndexLinks is array(map(x = y)) // this is wrong
>>>>
>>>> Any ideas?
>>>>
>>>> And again, thanks in advance.
>>>>
>>>>
>>>> I think the Assignment and References change in Lasso 9 might be
>>>> the problem but right now I can't see how to fix this.
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy Web Site Builder Soquel, CA
>>> <web@[Protected]> <http://www.StevePiercy.com/>
| From: Tami Williams | Date Sent: 2010-08-01 03:56:58 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
Steve:
The reason my sample file has the session_start AND session_addVar on
every page is that I wanted to replicate the way I code in real life
where I have a file called sessions.inc that I include in every page
in my site and in that file I do the session_start AND define all my
session vars.
So, all session var adds live in 1 file instead of being scattered
across different files in my site.
I've done this for as long as sessions have been available and had no
problems.
On Aug 1, 2010, at 4:52 AM, Steve Piercy - Web Site Builder wrote:
> First, you don't need to do this on every page:
>
> Session_Start('TestSessionX', -Expires=15, -UseLink);
> Session_AddVar('TestSessionX', 'testSessionVar');
>
> You need to do that only once, then on each subsequent page:
>
> Session_Start('TestSessionX', -Expires=15, -UseLink);
| From: Steve Piercy - Web Site Builder | Date Sent: 2010-08-01 04:44:34 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
No, a map does get inserted into an array (and it gets rendered
in the page), it just does not get inserted into the session.
And Tim's intuition about serialization, and Jolle's suggestion
to grab the source, led me to this test:
serialization_writer(array('moose','hair',map(1='one',2='two')))
<lassoType name="array">
<member>
<integerType>1</integerType>
<stringType><![CDATA[moose]]></stringType>
</member>
<member>
<integerType>2</integerType>
<stringType><![CDATA[hair]]></stringType>
</member>
<member>
<integerType>3</integerType>
<lassoType name="map">
<member>
<integerType>1</integerType>
<stringType><![CDATA[one]]></stringType>
</member>
<member>
<integerType>2</integerType>
<stringType><![CDATA[two]]></stringType>
</member>
</lassoType>
</member>
</lassoType>
So it appears that serialization is functioning as it should,
but something with the session manager is whacked where it just
won't accept a map as an element of an array. I couldn't find
anything in the Lasso 9 source that was relevant to sessions, so
I hit a brick wall.
Also in further testing, when I tried to simply insert a
key=value into a map variable, that works, but when trying to
add a map to a session it fails. It looks like sessions
discriminate against maps. My test consisted of changing my
test code as follows:
var('fruit') = array;
var('fruit') = map;
and
$fruit->insert(date->format('%q') = action_param('fruit'));
--steve
On 8/1/10 at 6:43 AM, tami@[Protected] (Tami Williams) pronounced:
>So, storing the map type inside the array when serialized into
>the session works when the map just has 1 pair. If the map has
>more than 1 pair, storing the map type inside the array when
>serialized into the session doesn't work.
>
>
>On Jul 31, 2010, at 11:42 PM, Tim Taplin wrote:
>
>>hmm, it looks like there is an issue with storing the map type
>>inside the array when serialized into the session.
>>
>>If I replace the insert map lines with insert pair, it works
>>as expected. So this looks like there may be some issue with
>>map serialization. Need to try to determine scope of the issue
>>and see if we can get it fixed. perhaps someone else can
>>confirm or better explain this issue.
>>
>>Tim
>>
>>On Jul 31, 2010, at 9:02 PM, Tami Williams wrote:
>>
>>>
>>>
>>>You can download a test page that shows the problem at
>http://www.asktami.com/download/Session.zip
>>>
>>>
>>>Then load the page at
>>>http://YourLP9IP/Session.lasso?action=p1
>>>
>>>
>>>First time it runs this line is uncommented and everything works:
>>>$IndexLinks->Insert(map('x' = 'y'));
>>>
>>>Then comment out this line:
>>>// $IndexLinks->Insert(map('x' = 'y'));
>>>
>>>and uncomment these lines and click through the pages and
>>>you'll see the problem:
>>>$IndexLinks->Insert(map('a' = 'b'));
>>>$IndexLinks->Insert(map('c' = 'd'));
>>>
>>>
>>>
>>>On Jul 31, 2010, at 7:16 PM, Steve Piercy - Web Site Builder wrote:
>>>
>>>>"I see dead colons."
>>>>
>>>>Also we're missing the context of how these variables are
>>>>stored in a session and how the session is started and
>>>>persists. IOW, the complete code sample required to
>>>>replicate and therefore better understand the issue is not present.
>>>>
>>>>--steve
>>>>
>>>>
>>>>On 7/31/10 at 6:54 PM, tami@[Protected] (Tami Williams) pronounced:
>>>>
>>>>>CODE WITHOUT COLONS below - no change in how it runs.
>>>>>
>>>>>
>>>>>OK, I'm getting closer and hope someone can help me.
>>>>>
>>>>>I have a session var call IndexLinks. Its an array. For
>>>>>testing purposes (to debug this) I'm setting it to be an
>>>>>empty array, then doing a conditional check to fill it with
>>>>>elements. Then I click on pages in the site to see if the
>>>>>session var now shows the new elements on all pages in the site.
>>>>>
>>>>>The problem is if I do multiple inserts - the session var
>>>>>doesn't get updated.
>>>>>A single insert works, multiple inserts (like from records
>>>>>in an inline search of a db) do not work.
>>>>>
>>>>>Note: I'm displaying the session var on my site pages like this:
>>>>><hr>
>>>>><br>IndexLinks is <b>[string(var('IndexLinks'))]</b>
>>>>>
>>>>>
>>>>>
>>>>>THIS WORKS:
>>>>>(Step 1)
>>>>>var('IndexLinks') = array();
>>>>>
>>>>>if((var:'IndexLinks')->type != 'array' ||
>>>>>(var:'IndexLinks')->size == 0);
>>>>>var('IndexLinks') = array();
>>>>>$IndexLinks->Insert(map('x' = 'y'));
>>>>>
>>>>>/if;
>>>>>
>>>>>On the 1st page, AND all subsequent pages, I see:
>>>>>IndexLinks is array(map(x = y))
>>>>>
>>>>>
>>>>>
>>>>>THIS DOES NOT WORK:
>>>>>
>>>>>IF I do Step 1 above then this (Step 2):
>>>>>
>>>>>var('IndexLinks') = array();
>>>>>
>>>>>if((var:'IndexLinks')->type != 'array' ||
>>>>>(var:'IndexLinks')->size == 0);
>>>>>var('IndexLinks') = array();
>>>>>
>>>>>$IndexLinks->Insert(map('a' = 'b'));
>>>>>$IndexLinks->Insert(map('c' = 'd'));
>>>>>
>>>>>/if;
>>>>>
>>>>>On the 1st page, I see:
>>>>>IndexLinks is array(map(a = b), map(c = d)) // this is right
>>>>>
>>>>>but on all other pages it shows as the old session var:
>>>>>IndexLinks is array(map(x = y)) // this is wrong
>>>>>
>>>>>Any ideas?
>>>>>
>>>>>And again, thanks in advance.
>>>>>
>>>>>
>>>>>I think the Assignment and References change in Lasso 9
>>>>>might be the problem but right now I can't see how to fix this.
>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>
>>>>>
>>>>
>>>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>Steve Piercy Web Site Builder Soquel, CA
>>>><web@[Protected]> <http://www.StevePiercy.com/>
>>>>
>>>>
>>>>--
>>>>
>>>>
>>>
>>>
>>>--
>>>
>>>
>>>
>>>
>>>--
>>>
>>>
>>
>>
>>--
>>
>>
>
>
>--
>
>
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy Web Site Builder
Soquel, CA
<web@[Protected]> <http://www.StevePiercy.com/>
| From: Steve Piercy - Web Site Builder | Date Sent: 2010-08-01 04:46:21 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
Not saying you should change the way you do things, just saying
what is not necessary overhead. My session driver is a single
globally included file, which contains the necessary logic to
execute only the necessary calls to the session manager. My
session example is a simplified version of it.
--steve
On 8/1/10 at 6:56 AM, tami@[Protected] (Tami Williams) pronounced:
>Steve:
>
>The reason my sample file has the session_start AND
>session_addVar on every page is that I wanted to replicate the
>way I code in real life where I have a file called sessions.inc
>that I include in every page in my site and in that file I do
>the session_start AND define all my session vars.
>
>So, all session var adds live in 1 file instead of being
>scattered across different files in my site.
>
>I've done this for as long as sessions have been available and had no problems.
>
>
>On Aug 1, 2010, at 4:52 AM, Steve Piercy - Web Site Builder wrote:
>
>>First, you don't need to do this on every page:
>>
>>Session_Start('TestSessionX', -Expires=15, -UseLink);
>>Session_AddVar('TestSessionX', 'testSessionVar');
>>
>>You need to do that only once, then on each subsequent page:
>>
>>Session_Start('TestSessionX', -Expires=15, -UseLink);
>
>
>--
>
>
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy Web Site Builder
Soquel, CA
<web@[Protected]> <http://www.StevePiercy.com/>
| From: Tami Williams | Date Sent: 2010-08-01 05:00:49 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
> session driver is a single globally included file
Mine too.
> contains the necessary logic to execute only the necessary calls
meaning conditionals?
On Aug 1, 2010, at 7:46 AM, Steve Piercy - Web Site Builder wrote:
> Not saying you should change the way you do things, just saying what
> is not necessary overhead. My session driver is a single globally
> included file, which contains the necessary logic to execute only
> the necessary calls to the session manager. My session example is a
> simplified version of it.
>
> --steve
>
>
> On 8/1/10 at 6:56 AM, tami@[Protected] (Tami Williams) pronounced:
>
>> Steve:
>>
>> The reason my sample file has the session_start AND session_addVar
>> on every page is that I wanted to replicate the way I code in real
>> life where I have a file called sessions.inc that I include in
>> every page in my site and in that file I do the session_start AND
>> define all my session vars.
>>
>> So, all session var adds live in 1 file instead of being scattered
>> across different files in my site.
>>
>> I've done this for as long as sessions have been available and had
>> no problems.
>>
>>
>> On Aug 1, 2010, at 4:52 AM, Steve Piercy - Web Site Builder wrote:
>>
>>> First, you don't need to do this on every page:
>>>
>>> Session_Start('TestSessionX', -Expires=15, -UseLink);
>>> Session_AddVar('TestSessionX', 'testSessionVar');
>>>
>>> You need to do that only once, then on each subsequent page:
>>>
>>> Session_Start('TestSessionX', -Expires=15, -UseLink);
>>
>>
>> --
>>
>>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy Web Site Builder Soquel, CA
> <web@[Protected]> <http://www.StevePiercy.com/>
| From: Tami Williams | Date Sent: 2010-08-01 05:11:44 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
Steve:
in my session.lasso demo file
if for action=p1
in the case statement for p1 I change the code from
$IndexLinks->Insert(map('x' = 'y'));
to:
$IndexLinks->Insert(map('x' = 'y', 'xx' = 'yy'));
then on p1, p2 and p3
IndexLinks is:
array(map(x = y, xx = yy))
IF I leave the p1 code as $IndexLinks->Insert(map('x' = 'y')); then on
p1,p2 and p3 IndexLinks is array(map(x = y)).
So, for both isn't that a map getting inserted both into the array and
into the session?
I think specifically the bug is inserting MULTIPLE maps into 1 array
var + session:
This doesn't work:
IndexLinks->Insert(map('a' = 'b'));
$IndexLinks->Insert(map('c' = 'd'));
Is that true for you?
On Aug 1, 2010, at 7:44 AM, Steve Piercy - Web Site Builder wrote:
> No, a map does get inserted into an array (and it gets rendered in
> the page), it just does not get inserted into the session.
>
> And Tim's intuition about serialization, and Jolle's suggestion to
> grab the source, led me to this test:
>
> serialization_writer(array('moose','hair',map(1='one',2='two')))
>
> <lassoType name="array">
> <member>
> <integerType>1</integerType>
> <stringType><![CDATA[moose]]></stringType>
> </member>
> <member>
> <integerType>2</integerType>
> <stringType><![CDATA[hair]]></stringType>
> </member>
> <member>
> <integerType>3</integerType>
> <lassoType name="map">
> <member>
> <integerType>1</integerType>
> <stringType><![CDATA[one]]></stringType>
> </member>
> <member>
> <integerType>2</integerType>
> <stringType><![CDATA[two]]></stringType>
> </member>
> </lassoType>
> </member>
> </lassoType>
>
> So it appears that serialization is functioning as it should, but
> something with the session manager is whacked where it just won't
> accept a map as an element of an array. I couldn't find anything in
> the Lasso 9 source that was relevant to sessions, so I hit a brick
> wall.
>
> Also in further testing, when I tried to simply insert a key=value
> into a map variable, that works, but when trying to add a map to a
> session it fails. It looks like sessions discriminate against
> maps. My test consisted of changing my test code as follows:
>
> var('fruit') = array;
> var('fruit') = map;
>
> and
>
> $fruit->insert(date->format('%q') = action_param('fruit'));
>
> --steve
>
>
> On 8/1/10 at 6:43 AM, tami@[Protected] (Tami Williams) pronounced:
>
>> So, storing the map type inside the array when serialized into the
>> session works when the map just has 1 pair. If the map has more
>> than 1 pair, storing the map type inside the array when serialized
>> into the session doesn't work.
>>
>>
>> On Jul 31, 2010, at 11:42 PM, Tim Taplin wrote:
>>
>>> hmm, it looks like there is an issue with storing the map type
>>> inside the array when serialized into the session.
>>>
>>> If I replace the insert map lines with insert pair, it works as
>>> expected. So this looks like there may be some issue with map
>>> serialization. Need to try to determine scope of the issue and see
>>> if we can get it fixed. perhaps someone else can confirm or better
>>> explain this issue.
>>>
>>> Tim
>>>
>>> On Jul 31, 2010, at 9:02 PM, Tami Williams wrote:
>>>
>>>>
>>>>
>>>> You can download a test page that shows the problem at
>> http://www.asktami.com/download/Session.zip
>>>>
>>>>
>>>> Then load the page at
>>>> http://YourLP9IP/Session.lasso?action=p1
>>>>
>>>>
>>>> First time it runs this line is uncommented and everything works:
>>>> $IndexLinks->Insert(map('x' = 'y'));
>>>>
>>>> Then comment out this line:
>>>> // $IndexLinks->Insert(map('x' = 'y'));
>>>>
>>>> and uncomment these lines and click through the pages and you'll
>>>> see the problem:
>>>> $IndexLinks->Insert(map('a' = 'b'));
>>>> $IndexLinks->Insert(map('c' = 'd'));
>>>>
>>>>
>>>>
>>>> On Jul 31, 2010, at 7:16 PM, Steve Piercy - Web Site Builder wrote:
>>>>
>>>>> "I see dead colons."
>>>>>
>>>>> Also we're missing the context of how these variables are stored
>>>>> in a session and how the session is started and persists. IOW,
>>>>> the complete code sample required to replicate and therefore
>>>>> better understand the issue is not present.
>>>>>
>>>>> --steve
>>>>>
>>>>>
>>>>> On 7/31/10 at 6:54 PM, tami@[Protected] (Tami Williams)
>>>>> pronounced:
>>>>>
>>>>>> CODE WITHOUT COLONS below - no change in how it runs.
>>>>>>
>>>>>>
>>>>>> OK, I'm getting closer and hope someone can help me.
>>>>>>
>>>>>> I have a session var call IndexLinks. Its an array. For
>>>>>> testing purposes (to debug this) I'm setting it to be an empty
>>>>>> array, then doing a conditional check to fill it with
>>>>>> elements. Then I click on pages in the site to see if the
>>>>>> session var now shows the new elements on all pages in the site.
>>>>>>
>>>>>> The problem is if I do multiple inserts - the session var
>>>>>> doesn't get updated.
>>>>>> A single insert works, multiple inserts (like from records in
>>>>>> an inline search of a db) do not work.
>>>>>>
>>>>>> Note: I'm displaying the session var on my site pages like this:
>>>>>> <hr>
>>>>>> <br>IndexLinks is <b>[string(var('IndexLinks'))]</b>
>>>>>>
>>>>>>
>>>>>>
>>>>>> THIS WORKS:
>>>>>> (Step 1)
>>>>>> var('IndexLinks') = array();
>>>>>>
>>>>>> if((var:'IndexLinks')->type != 'array' || (var:'IndexLinks')-
>>>>>> >size == 0);
>>>>>> var('IndexLinks') = array();
>>>>>> $IndexLinks->Insert(map('x' = 'y'));
>>>>>>
>>>>>> /if;
>>>>>>
>>>>>> On the 1st page, AND all subsequent pages, I see:
>>>>>> IndexLinks is array(map(x = y))
>>>>>>
>>>>>>
>>>>>>
>>>>>> THIS DOES NOT WORK:
>>>>>>
>>>>>> IF I do Step 1 above then this (Step 2):
>>>>>>
>>>>>> var('IndexLinks') = array();
>>>>>>
>>>>>> if((var:'IndexLinks')->type != 'array' || (var:'IndexLinks')-
>>>>>> >size == 0);
>>>>>> var('IndexLinks') = array();
>>>>>>
>>>>>> $IndexLinks->Insert(map('a' = 'b'));
>>>>>> $IndexLinks->Insert(map('c' = 'd'));
>>>>>>
>>>>>> /if;
>>>>>>
>>>>>> On the 1st page, I see:
>>>>>> IndexLinks is array(map(a = b), map(c = d)) // this is right
>>>>>>
>>>>>> but on all other pages it shows as the old session var:
>>>>>> IndexLinks is array(map(x = y)) // this is wrong
>>>>>>
>>>>>> Any ideas?
>>>>>>
>>>>>> And again, thanks in advance.
>>>>>>
>>>>>>
>>>>>> I think the Assignment and References change in Lasso 9 might
>>>>>> be the problem but right now I can't see how to fix this.
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>
>>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>> -- --
>>>>> Steve Piercy Web Site Builder
>>>>> Soquel, CA
>>>>> <web@[Protected]> <http://www.StevePiercy.com/
>>>>> >
>>>>>
>>>>>
>>>>> --
>>>>> This list is a free service of LassoSoft: http://
>>>>> www.LassoSoft.com/
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>>
>>
>>
>> --
>>
>>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy Web Site Builder Soquel, CA
> <web@[Protected]> <http://www.StevePiercy.com/>
| From: Steve Piercy - Web Site Builder | Date Sent: 2010-08-01 05:40:36 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
On 8/1/10 at 8:00 AM, tami@[Protected] (Tami Williams) pronounced:
>>contains the necessary logic to execute only the necessary calls
>meaning conditionals?
Yup. Basically grab the request, parse it, and determine what
kind of session and/or authentication is necessary for the
requested resource. So instead of this:
session_start
session_addvar
if
else
/if
I move the session tags within the logic:
if(logout)
// end session
else
if(start)
// start session
/if
if(addvar)
// add session var
/if
/if
That's a very crude model, but you get the idea.
I also declare the type of my variables almost always at the top
of the file, then refer to them with the shortcut $varname.
BBEdit has some nice auto-completion, so when I type "$mo" I can
select "$moosehair".
--steve
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy Web Site Builder
Soquel, CA
<web@[Protected]> <http://www.StevePiercy.com/>
| From: Steve Piercy - Web Site Builder | Date Sent: 2010-08-01 06:17:53 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
Well, there is another issue I just noticed. Every time I click
the link to go to the first page, the session does not decorate
the links on the resulting page with the session ID. I think
we've been looking at the wrong thing this whole time.
In my example, I use cookies so I don't get that weirdness.
So perhaps your issue is two issues?
--steve
On 8/1/10 at 8:11 AM, tami@[Protected] (Tami Williams) pronounced:
>Steve:
>
>in my session.lasso demo file
>
>if for action=p1
>in the case statement for p1 I change the code from
>$IndexLinks->Insert(map('x' = 'y'));
>
>to:
>$IndexLinks->Insert(map('x' = 'y', 'xx' = 'yy'));
>
>then on p1, p2 and p3
>IndexLinks is:
>array(map(x = y, xx = yy))
>
>IF I leave the p1 code as $IndexLinks->Insert(map('x' = 'y'));
>then on p1,p2 and p3 IndexLinks is array(map(x = y)).
>
>So, for both isn't that a map getting inserted both into the
>array and into the session?
>
>I think specifically the bug is inserting MULTIPLE maps into 1 array var + session:
>
>
>This doesn't work:
>IndexLinks->Insert(map('a' = 'b'));
>$IndexLinks->Insert(map('c' = 'd'));
>
>Is that true for you?
>
>
>On Aug 1, 2010, at 7:44 AM, Steve Piercy - Web Site Builder wrote:
>
>>No, a map does get inserted into an array (and it gets
>>rendered in the page), it just does not get inserted into the session.
>>
>>And Tim's intuition about serialization, and Jolle's
>>suggestion to grab the source, led me to this test:
>>
>>serialization_writer(array('moose','hair',map(1='one',2='two')))
>>
>><lassoType name="array">
>><member>
>><integerType>1</integerType>
>><stringType><![CDATA[moose]]></stringType>
>></member>
>><member>
>><integerType>2</integerType>
>><stringType><![CDATA[hair]]></stringType>
>></member>
>><member>
>><integerType>3</integerType>
>><lassoType name="map">
>><member>
>><integerType>1</integerType>
>><stringType><![CDATA[one]]></stringType>
>></member>
>><member>
>><integerType>2</integerType>
>><stringType><![CDATA[two]]></stringType>
>></member>
>></lassoType>
>></member>
>></lassoType>
>>
>>So it appears that serialization is functioning as it should,
>>but something with the session manager is whacked where it
>>just won't accept a map as an element of an array. I couldn't
>>find anything in the Lasso 9 source that was relevant to
>>sessions, so I hit a brick wall.
>>
>>Also in further testing, when I tried to simply insert a
>>key=value into a map variable, that works, but when trying to
>>add a map to a session it fails. It looks like sessions
>>discriminate against maps. My test consisted of changing my
>>test code as follows:
>>
>>var('fruit') = array;
>>var('fruit') = map;
>>
>>and
>>
>>$fruit->insert(date->format('%q') = action_param('fruit'));
>>
>>--steve
>>
>>
>>On 8/1/10 at 6:43 AM, tami@[Protected] (Tami Williams) pronounced:
>>
>>>So, storing the map type inside the array when serialized
>>>into the session works when the map just has 1 pair. If the
>>>map has more than 1 pair, storing the map type inside the
>>>array when serialized into the session doesn't work.
>>>
>>>
>>>On Jul 31, 2010, at 11:42 PM, Tim Taplin wrote:
>>>
>>>>hmm, it looks like there is an issue with storing the map
>>>>type inside the array when serialized into the session.
>>>>
>>>>If I replace the insert map lines with insert pair, it works
>>>>as expected. So this looks like there may be some issue with
>>>>map serialization. Need to try to determine scope of the
>>>>issue and see if we can get it fixed. perhaps someone else
>>>>can confirm or better explain this issue.
>>>>
>>>>Tim
>>>>
>>>>On Jul 31, 2010, at 9:02 PM, Tami Williams wrote:
>>>>
>>>>>
>>>>>
>>>>>You can download a test page that shows the problem at
>>>http://www.asktami.com/download/Session.zip
>>>>>
>>>>>
>>>>>Then load the page at
>>>>>http://YourLP9IP/Session.lasso?action=p1
>>>>>
>>>>>
>>>>>First time it runs this line is uncommented and everything works:
>>>>>$IndexLinks->Insert(map('x' = 'y'));
>>>>>
>>>>>Then comment out this line:
>>>>>// $IndexLinks->Insert(map('x' = 'y'));
>>>>>
>>>>>and uncomment these lines and click through the pages and
>>>>>you'll see the problem:
>>>>>$IndexLinks->Insert(map('a' = 'b'));
>>>>>$IndexLinks->Insert(map('c' = 'd'));
>>>>>
>>>>>
>>>>>
>>>>>On Jul 31, 2010, at 7:16 PM, Steve Piercy - Web Site Builder wrote:
>>>>>
>>>>>>"I see dead colons."
>>>>>>
>>>>>>Also we're missing the context of how these variables are
>>>>>>stored in a session and how the session is started and
>>>>>>persists. IOW, the complete code sample required to
>>>>>>replicate and therefore better understand the issue is not present.
>>>>>>
>>>>>>--steve
>>>>>>
>>>>>>
>>>>>>On 7/31/10 at 6:54 PM, tami@[Protected] (Tami Williams) pronounced:
>>>>>>
>>>>>>>CODE WITHOUT COLONS below - no change in how it runs.
>>>>>>>
>>>>>>>
>>>>>>>OK, I'm getting closer and hope someone can help me.
>>>>>>>
>>>>>>>I have a session var call IndexLinks. Its an array. For
>>>>>>>testing purposes (to debug this) I'm setting it to be an
>>>>>>>empty array, then doing a conditional check to fill it
>>>>>>>with elements. Then I click on pages in the site to see
>>>>>>>if the session var now shows the new elements on all
>>>>>>>pages in the site.
>>>>>>>
>>>>>>>The problem is if I do multiple inserts - the session var
>>>>>>>doesn't get updated.
>>>>>>>A single insert works, multiple inserts (like from
>>>>>>>records in an inline search of a db) do not work.
>>>>>>>
>>>>>>>Note: I'm displaying the session var on my site pages like this:
>>>>>>><hr>
>>>>>>><br>IndexLinks is <b>[string(var('IndexLinks'))]</b>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>THIS WORKS:
>>>>>>>(Step 1)
>>>>>>>var('IndexLinks') = array();
>>>>>>>
>>>>>>>if((var:'IndexLinks')->type != 'array' ||
>>>>>>>(var:'IndexLinks')->size == 0);
>>>>>>>var('IndexLinks') = array();
>>>>>>>$IndexLinks->Insert(map('x' = 'y'));
>>>>>>>
>>>>>>>/if;
>>>>>>>
>>>>>>>On the 1st page, AND all subsequent pages, I see:
>>>>>>>IndexLinks is array(map(x = y))
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>THIS DOES NOT WORK:
>>>>>>>
>>>>>>>IF I do Step 1 above then this (Step 2):
>>>>>>>
>>>>>>>var('IndexLinks') = array();
>>>>>>>
>>>>>>>if((var:'IndexLinks')->type != 'array' ||
>>>>>>>(var:'IndexLinks')->size == 0);
>>>>>>>var('IndexLinks') = array();
>>>>>>>
>>>>>>>$IndexLinks->Insert(map('a' = 'b'));
>>>>>>>$IndexLinks->Insert(map('c' = 'd'));
>>>>>>>
>>>>>>>/if;
>>>>>>>
>>>>>>>On the 1st page, I see:
>>>>>>>IndexLinks is array(map(a = b), map(c = d)) // this is right
>>>>>>>
>>>>>>>but on all other pages it shows as the old session var:
>>>>>>>IndexLinks is array(map(x = y)) // this is wrong
>>>>>>>
>>>>>>>Any ideas?
>>>>>>>
>>>>>>>And again, thanks in advance.
>>>>>>>
>>>>>>>
>>>>>>>I think the Assignment and References change in Lasso 9
>>>>>>>might be the problem but right now I can't see how to fix this.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>--
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>--
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>--
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>>-- -- -- --
>>>>>>Steve Piercy Web Site Builder
>>>>>>Soquel, CA
>>>>>><web@[Protected]> <http://www.StevePiercy.com/>
>>>>>>
>>>>>>
>>>>>>--
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>
>>>>>
>>>>
>>>>
>>>>--
>>>>
>>>>
>>>
>>>
>>>--
>>>
>>>
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy Web Site Builder Soquel, CA
>><web@[Protected]> <http://www.StevePiercy.com/>
>>
>>
>>--
>>
>>
>
>
>--
>
>
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy Web Site Builder
Soquel, CA
<web@[Protected]> <http://www.StevePiercy.com/>
| From: Tami Williams | Date Sent: 2010-08-01 06:35:09 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
Do -UseAuto, same problem. Doesn't matter if I use -UseAuto, or -
UseLink or -UseCookie, always has the same problem.
> In my example, I use cookies so I don't get that weirdness.
Really? You ran my sample sessions.lasso and changed it from -UseLink
to -UseCookie and didn't see the problem?
On Aug 1, 2010, at 9:17 AM, Steve Piercy - Web Site Builder wrote:
> Well, there is another issue I just noticed. Every time I click the
> link to go to the first page, the session does not decorate the
> links on the resulting page with the session ID. I think we've been
> looking at the wrong thing this whole time.
>
> In my example, I use cookies so I don't get that weirdness.
>
> So perhaps your issue is two issues?
>
> --steve
>
>
> On 8/1/10 at 8:11 AM, tami@[Protected] (Tami Williams) pronounced:
>
>> Steve:
>>
>> in my session.lasso demo file
>>
>> if for action=p1
>> in the case statement for p1 I change the code from
>> $IndexLinks->Insert(map('x' = 'y'));
>>
>> to:
>> $IndexLinks->Insert(map('x' = 'y', 'xx' = 'yy'));
>>
>> then on p1, p2 and p3
>> IndexLinks is:
>> array(map(x = y, xx = yy))
>>
>> IF I leave the p1 code as $IndexLinks->Insert(map('x' = 'y')); then
>> on p1,p2 and p3 IndexLinks is array(map(x = y)).
>>
>> So, for both isn't that a map getting inserted both into the array
>> and into the session?
>>
>> I think specifically the bug is inserting MULTIPLE maps into 1
>> array var + session:
>>
>>
>> This doesn't work:
>> IndexLinks->Insert(map('a' = 'b'));
>> $IndexLinks->Insert(map('c' = 'd'));
>>
>> Is that true for you?
>>
>>
>> On Aug 1, 2010, at 7:44 AM, Steve Piercy - Web Site Builder wrote:
>>
>>> No, a map does get inserted into an array (and it gets rendered in
>>> the page), it just does not get inserted into the session.
>>>
>>> And Tim's intuition about serialization, and Jolle's suggestion to
>>> grab the source, led me to this test:
>>>
>>> serialization_writer(array('moose','hair',map(1='one',2='two')))
>>>
>>> <lassoType name="array">
>>> <member>
>>> <integerType>1</integerType>
>>> <stringType><![CDATA[moose]]></stringType>
>>> </member>
>>> <member>
>>> <integerType>2</integerType>
>>> <stringType><![CDATA[hair]]></stringType>
>>> </member>
>>> <member>
>>> <integerType>3</integerType>
>>> <lassoType name="map">
>>> <member>
>>> <integerType>1</integerType>
>>> <stringType><![CDATA[one]]></stringType>
>>> </member>
>>> <member>
>>> <integerType>2</integerType>
>>> <stringType><![CDATA[two]]></stringType>
>>> </member>
>>> </lassoType>
>>> </member>
>>> </lassoType>
>>>
>>> So it appears that serialization is functioning as it should, but
>>> something with the session manager is whacked where it just won't
>>> accept a map as an element of an array. I couldn't find anything
>>> in the Lasso 9 source that was relevant to sessions, so I hit a
>>> brick wall.
>>>
>>> Also in further testing, when I tried to simply insert a key=value
>>> into a map variable, that works, but when trying to add a map to a
>>> session it fails. It looks like sessions discriminate against
>>> maps. My test consisted of changing my test code as follows:
>>>
>>> var('fruit') = array;
>>> var('fruit') = map;
>>>
>>> and
>>>
>>> $fruit->insert(date->format('%q') = action_param('fruit'));
>>>
>>> --steve
>>>
>>>
>>> On 8/1/10 at 6:43 AM, tami@[Protected] (Tami Williams) pronounced:
>>>
>>>> So, storing the map type inside the array when serialized into
>>>> the session works when the map just has 1 pair. If the map has
>>>> more than 1 pair, storing the map type inside the array when
>>>> serialized into the session doesn't work.
>>>>
>>>>
>>>> On Jul 31, 2010, at 11:42 PM, Tim Taplin wrote:
>>>>
>>>>> hmm, it looks like there is an issue with storing the map type
>>>>> inside the array when serialized into the session.
>>>>>
>>>>> If I replace the insert map lines with insert pair, it works as
>>>>> expected. So this looks like there may be some issue with map
>>>>> serialization. Need to try to determine scope of the issue and
>>>>> see if we can get it fixed. perhaps someone else can confirm or
>>>>> better explain this issue.
>>>>>
>>>>> Tim
>>>>>
>>>>> On Jul 31, 2010, at 9:02 PM, Tami Williams wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> You can download a test page that shows the problem at
>>>> http://www.asktami.com/download/Session.zip
>>>>>>
>>>>>>
>>>>>> Then load the page at
>>>>>> http://YourLP9IP/Session.lasso?action=p1
>>>>>>
>>>>>>
>>>>>> First time it runs this line is uncommented and everything works:
>>>>>> $IndexLinks->Insert(map('x' = 'y'));
>>>>>>
>>>>>> Then comment out this line:
>>>>>> // $IndexLinks->Insert(map('x' = 'y'));
>>>>>>
>>>>>> and uncomment these lines and click through the pages and
>>>>>> you'll see the problem:
>>>>>> $IndexLinks->Insert(map('a' = 'b'));
>>>>>> $IndexLinks->Insert(map('c' = 'd'));
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Jul 31, 2010, at 7:16 PM, Steve Piercy - Web Site Builder
>>>>>> wrote:
>>>>>>
>>>>>>> "I see dead colons."
>>>>>>>
>>>>>>> Also we're missing the context of how these variables are
>>>>>>> stored in a session and how the session is started and
>>>>>>> persists. IOW, the complete code sample required to replicate
>>>>>>> and therefore better understand the issue is not present.
>>>>>>>
>>>>>>> --steve
>>>>>>>
>>>>>>>
>>>>>>> On 7/31/10 at 6:54 PM, tami@[Protected] (Tami Williams)
>>>>>>> pronounced:
>>>>>>>
>>>>>>>> CODE WITHOUT COLONS below - no change in how it runs.
>>>>>>>>
>>>>>>>>
>>>>>>>> OK, I'm getting closer and hope someone can help me.
>>>>>>>>
>>>>>>>> I have a session var call IndexLinks. Its an array. For
>>>>>>>> testing purposes (to debug this) I'm setting it to be an
>>>>>>>> empty array, then doing a conditional check to fill it with
>>>>>>>> elements. Then I click on pages in the site to see if the
>>>>>>>> session var now shows the new elements on all pages in the
>>>>>>>> site.
>>>>>>>>
>>>>>>>> The problem is if I do multiple inserts - the session var
>>>>>>>> doesn't get updated.
>>>>>>>> A single insert works, multiple inserts (like from records in
>>>>>>>> an inline search of a db) do not work.
>>>>>>>>
>>>>>>>> Note: I'm displaying the session var on my site pages like
>>>>>>>> this:
>>>>>>>> <hr>
>>>>>>>> <br>IndexLinks is <b>[string(var('IndexLinks'))]</b>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> THIS WORKS:
>>>>>>>> (Step 1)
>>>>>>>> var('IndexLinks') = array();
>>>>>>>>
>>>>>>>> if((var:'IndexLinks')->type != 'array' || (var:'IndexLinks')-
>>>>>>>> >size == 0);
>>>>>>>> var('IndexLinks') = array();
>>>>>>>> $IndexLinks->Insert(map('x' = 'y'));
>>>>>>>>
>>>>>>>> /if;
>>>>>>>>
>>>>>>>> On the 1st page, AND all subsequent pages, I see:
>>>>>>>> IndexLinks is array(map(x = y))
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> THIS DOES NOT WORK:
>>>>>>>>
>>>>>>>> IF I do Step 1 above then this (Step 2):
>>>>>>>>
>>>>>>>> var('IndexLinks') = array();
>>>>>>>>
>>>>>>>> if((var:'IndexLinks')->type != 'array' || (var:'IndexLinks')-
>>>>>>>> >size == 0);
>>>>>>>> var('IndexLinks') = array();
>>>>>>>>
>>>>>>>> $IndexLinks->Insert(map('a' = 'b'));
>>>>>>>> $IndexLinks->Insert(map('c' = 'd'));
>>>>>>>>
>>>>>>>> /if;
>>>>>>>>
>>>>>>>> On the 1st page, I see:
>>>>>>>> IndexLinks is array(map(a = b), map(c = d)) // this is right
>>>>>>>>
>>>>>>>> but on all other pages it shows as the old session var:
>>>>>>>> IndexLinks is array(map(x = y)) // this is wrong
>>>>>>>>
>>>>>>>> Any ideas?
>>>>>>>>
>>>>>>>> And again, thanks in advance.
>>>>>>>>
>>>>>>>>
>>>>>>>> I think the Assignment and References change in Lasso 9 might
>>>>>>>> be the problem but right now I can't see how to fix this.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>>> -- --
>>>>>>> Steve Piercy Web Site Builder
>>>>>>> Soquel, CA
>>>>>>> <web@[Protected]> <http://www.StevePiercy.com/
>>>>>>> >
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Browse/
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> This list is a free service of LassoSoft: http://
>>>>> www.LassoSoft.com/
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy Web Site Builder Soquel, CA
>>> <web@[Protected]> <http://www.StevePiercy.com/>
>>>
>>>
>>> --
>>>
>>>
>>
>>
>> --
>>
>>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy Web Site Builder Soquel, CA
> <web@[Protected]> <http://www.StevePiercy.com/>
| From: Steve Piercy - Web Site Builder | Date Sent: 2010-08-01 07:17:32 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
On 8/1/10 at 9:35 AM, tami@[Protected] (Tami Williams) pronounced:
>Do -UseAuto, same problem. Doesn't matter if I use -UseAuto,
>or -UseLink or -UseCookie, always has the same problem.
Well, no, it does matter. If there is no session ID in the link
and you are using -uselink, then the session ends. That's
another issue.
>>In my example, I use cookies so I don't get that weirdness.
>Really? You ran my sample sessions.lasso and changed it from
>-UseLink to -UseCookie and didn't see the problem?
The weirdness to which I refer is not the behavior we have been
discussing (although related), but the fact that the first page
fails to decorate links with the session ID.
Anyway, back to the session thing, you are correct. You can add
exactly one map to the array and add that array to the session.
But whenever you add more than one map to the array, and try to
add the array to the session, the array fails to get added to
the session. The session value is not changed, and it retains
its previous value.
With this timestamp thingie you can see better what is really
going on.
$indexlinks->insert(map(date->format('%q') = 'b'));
--steve
>On Aug 1, 2010, at 9:17 AM, Steve Piercy - Web Site Builder wrote:
>
>>Well, there is another issue I just noticed. Every time I
>>click the link to go to the first page, the session does not
>>decorate the links on the resulting page with the session ID.
>>I think we've been looking at the wrong thing this whole time.
>>
>>In my example, I use cookies so I don't get that weirdness.
>>
>>So perhaps your issue is two issues?
>>
>>--steve
>>
>>
>>On 8/1/10 at 8:11 AM, tami@[Protected] (Tami Williams) pronounced:
>>
>>>Steve:
>>>
>>>in my session.lasso demo file
>>>
>>>if for action=p1
>>>in the case statement for p1 I change the code from
>>>$IndexLinks->Insert(map('x' = 'y'));
>>>
>>>to:
>>>$IndexLinks->Insert(map('x' = 'y', 'xx' = 'yy'));
>>>
>>>then on p1, p2 and p3
>>>IndexLinks is:
>>>array(map(x = y, xx = yy))
>>>
>>>IF I leave the p1 code as $IndexLinks->Insert(map('x' =
>>>'y')); then on p1,p2 and p3 IndexLinks is array(map(x = y)).
>>>
>>>So, for both isn't that a map getting inserted both into the
>>>array and into the session?
>>>
>>>I think specifically the bug is inserting MULTIPLE maps into
>>>1 array var + session:
>>>
>>>
>>>This doesn't work:
>>>IndexLinks->Insert(map('a' = 'b'));
>>>$IndexLinks->Insert(map('c' = 'd'));
>>>
>>>Is that true for you?
>>>
>>>
>>>On Aug 1, 2010, at 7:44 AM, Steve Piercy - Web Site Builder wrote:
>>>
>>>>No, a map does get inserted into an array (and it gets
>>>>rendered in the page), it just does not get inserted into
>>>>the session.
>>>>
>>>>And Tim's intuition about serialization, and Jolle's
>>>>suggestion to grab the source, led me to this test:
>>>>
>>>>serialization_writer(array('moose','hair',map(1='one',2='two')))
>>>>
>>>><lassoType name="array">
>>>><member>
>>>><integerType>1</integerType>
>>>><stringType><![CDATA[moose]]></stringType>
>>>></member>
>>>><member>
>>>><integerType>2</integerType>
>>>><stringType><![CDATA[hair]]></stringType>
>>>></member>
>>>><member>
>>>><integerType>3</integerType>
>>>><lassoType name="map">
>>>><member>
>>>><integerType>1</integerType>
>>>><stringType><![CDATA[one]]></stringType>
>>>></member>
>>>><member>
>>>><integerType>2</integerType>
>>>><stringType><![CDATA[two]]></stringType>
>>>></member>
>>>></lassoType>
>>>></member>
>>>></lassoType>
>>>>
>>>>So it appears that serialization is functioning as it
>>>>should, but something with the session manager is whacked
>>>>where it just won't accept a map as an element of an array.
>>>>I couldn't find anything in the Lasso 9 source that was
>>>>relevant to sessions, so I hit a brick wall.
>>>>
>>>>Also in further testing, when I tried to simply insert a
>>>>key=value into a map variable, that works, but when trying
>>>>to add a map to a session it fails. It looks like sessions
>>>>discriminate against maps. My test consisted of changing my
>>>>test code as follows:
>>>>
>>>>var('fruit') = array;
>>>>var('fruit') = map;
>>>>
>>>>and
>>>>
>>>>$fruit->insert(date->format('%q') = action_param('fruit'));
>>>>
>>>>--steve
>>>>
>>>>
>>>>On 8/1/10 at 6:43 AM, tami@[Protected] (Tami Williams) pronounced:
>>>>
>>>>>So, storing the map type inside the array when serialized
>>>>>into the session works when the map just has 1 pair. If
>>>>>the map has more than 1 pair, storing the map type inside
>>>>>the array when serialized into the session doesn't work.
>>>>>
>>>>>
>>>>>On Jul 31, 2010, at 11:42 PM, Tim Taplin wrote:
>>>>>
>>>>>>hmm, it looks like there is an issue with storing the map
>>>>>>type inside the array when serialized into the session.
>>>>>>
>>>>>>If I replace the insert map lines with insert pair, it
>>>>>>works as expected. So this looks like there may be some
>>>>>>issue with map serialization. Need to try to determine
>>>>>>scope of the issue and see if we can get it fixed. perhaps
>>>>>>someone else can confirm or better explain this issue.
>>>>>>
>>>>>>Tim
>>>>>>
>>>>>>On Jul 31, 2010, at 9:02 PM, Tami Williams wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>You can download a test page that shows the problem at
>>>>>http://www.asktami.com/download/Session.zip
>>>>>>>
>>>>>>>
>>>>>>>Then load the page at
>>>>>>>http://YourLP9IP/Session.lasso?action=p1
>>>>>>>
>>>>>>>
>>>>>>>First time it runs this line is uncommented and everything works:
>>>>>>>$IndexLinks->Insert(map('x' = 'y'));
>>>>>>>
>>>>>>>Then comment out this line:
>>>>>>>// $IndexLinks->Insert(map('x' = 'y'));
>>>>>>>
>>>>>>>and uncomment these lines and click through the pages and
>>>>>>>you'll see the problem:
>>>>>>>$IndexLinks->Insert(map('a' = 'b'));
>>>>>>>$IndexLinks->Insert(map('c' = 'd'));
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>On Jul 31, 2010, at 7:16 PM, Steve Piercy - Web Site
>>>>>>>Builder wrote:
>>>>>>>
>>>>>>>>"I see dead colons."
>>>>>>>>
>>>>>>>>Also we're missing the context of how these variables
>>>>>>>>are stored in a session and how the session is started
>>>>>>>>and persists. IOW, the complete code sample required to
>>>>>>>>replicate and therefore better understand the issue is
>>>>>>>>not present.
>>>>>>>>
>>>>>>>>--steve
>>>>>>>>
>>>>>>>>
>>>>>>>>On 7/31/10 at 6:54 PM, tami@[Protected] (Tami Williams) pronounced:
>>>>>>>>
>>>>>>>>>CODE WITHOUT COLONS below - no change in how it runs.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>OK, I'm getting closer and hope someone can help me.
>>>>>>>>>
>>>>>>>>>I have a session var call IndexLinks. Its an array.
>>>>>>>>>For testing purposes (to debug this) I'm setting it to
>>>>>>>>>be an empty array, then doing a conditional check to
>>>>>>>>>fill it with elements. Then I click on pages in the
>>>>>>>>>site to see if the session var now shows the new
>>>>>>>>>elements on all pages in the site.
>>>>>>>>>
>>>>>>>>>The problem is if I do multiple inserts - the session
>>>>>>>>>var doesn't get updated.
>>>>>>>>>A single insert works, multiple inserts (like from
>>>>>>>>>records in an inline search of a db) do not work.
>>>>>>>>>
>>>>>>>>>Note: I'm displaying the session var on my site pages
>>>>>>>>>like this:
>>>>>>>>><hr>
>>>>>>>>><br>IndexLinks is <b>[string(var('IndexLinks'))]</b>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>THIS WORKS:
>>>>>>>>>(Step 1)
>>>>>>>>>var('IndexLinks') = array();
>>>>>>>>>
>>>>>>>>>if((var:'IndexLinks')->type != 'array' ||
>>>>>>>>>(var:'IndexLinks')->size == 0);
>>>>>>>>>var('IndexLinks') = array();
>>>>>>>>>$IndexLinks->Insert(map('x' = 'y'));
>>>>>>>>>
>>>>>>>>>/if;
>>>>>>>>>
>>>>>>>>>On the 1st page, AND all subsequent pages, I see:
>>>>>>>>>IndexLinks is array(map(x = y))
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>THIS DOES NOT WORK:
>>>>>>>>>
>>>>>>>>>IF I do Step 1 above then this (Step 2):
>>>>>>>>>
>>>>>>>>>var('IndexLinks') = array();
>>>>>>>>>
>>>>>>>>>if((var:'IndexLinks')->type != 'array' ||
>>>>>>>>>(var:'IndexLinks')->size == 0);
>>>>>>>>>var('IndexLinks') = array();
>>>>>>>>>
>>>>>>>>>$IndexLinks->Insert(map('a' = 'b'));
>>>>>>>>>$IndexLinks->Insert(map('c' = 'd'));
>>>>>>>>>
>>>>>>>>>/if;
>>>>>>>>>
>>>>>>>>>On the 1st page, I see:
>>>>>>>>>IndexLinks is array(map(a = b), map(c = d)) // this is right
>>>>>>>>>
>>>>>>>>>but on all other pages it shows as the old session var:
>>>>>>>>>IndexLinks is array(map(x = y)) // this is wrong
>>>>>>>>>
>>>>>>>>>Any ideas?
>>>>>>>>>
>>>>>>>>>And again, thanks in advance.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>I think the Assignment and References change in Lasso 9
>>>>>>>>>might be the problem but right now I can't see how to
>>>>>>>>>fix this.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>--
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>--
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>--
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>>>>-- -- -- --
>>>>>>>>Steve Piercy Web Site
>>>>>>>>Builder Soquel, CA
>>>>>>>><web@[Protected]> <http://www.StevePiercy.com/>
>>>>>>>>
>>>>>>>>
>>>>>>>>--
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>--
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>--
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>--
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>
>>>>>
>>>>
>>>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>Steve Piercy Web Site Builder Soquel, CA
>>>><web@[Protected]> <http://www.StevePiercy.com/>
>>>>
>>>>
>>>>--
>>>>
>>>>
>>>
>>>
>>>--
>>>
>>>
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy Web Site Builder Soquel, CA
>><web@[Protected]> <http://www.StevePiercy.com/>
>>
>>
>>--
>>
>>
>
>
>--
>
>
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy Web Site Builder
Soquel, CA
<web@[Protected]> <http://www.StevePiercy.com/>
| From: Rick Draper | Date Sent: 2010-08-01 12:58:42 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
Hi Tami,
It's possible to do what you want without adding the session vars on each
page - I do the same as you and have a sessions.inc page. My logic is as
follows and avoids setting sessions if its just a bot:
If(lp_client_isBot);
// set session variables to empty to avoid any errors
Var('sv_User')='';
//... Etc...
Else;
Session_Start(-Name=$Session_Name, -Expires=$Session_Duration,
-UseAuto); // restart the session
Var('Session_Result') = Session_Result;
/If;
If($Session_Result == 'new' || $Session_Result == 'expire');
// If this is the start of the session, set the variables that will be used
session_addvar(-name=$Session_Name,
'sv_User');
// set the variables to their initial values
Var('sv_User') = Map('User_ID' = $User_ID);
/If;
Very best regards,
Rick
-----Original Message-----
From: Lasso Talk [mailto:lasso@[Protected]] On Behalf Of Tami
Williams
Sent: Sunday, 1 August 2010 8:57 PM
To: Lasso Talk
Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt
2 DOWNLOAD LINK CORRECTION
Steve:
The reason my sample file has the session_start AND session_addVar on every
page is that I wanted to replicate the way I code in real life where I have
a file called sessions.inc that I include in every page in my site and in
that file I do the session_start AND define all my session vars.
So, all session var adds live in 1 file instead of being scattered across
different files in my site.
I've done this for as long as sessions have been available and had no
problems.
On Aug 1, 2010, at 4:52 AM, Steve Piercy - Web Site Builder wrote:
> First, you don't need to do this on every page:
>
> Session_Start('TestSessionX', -Expires=15, -UseLink);
> Session_AddVar('TestSessionX', 'testSessionVar');
>
> You need to do that only once, then on each subsequent page:
>
> Session_Start('TestSessionX', -Expires=15, -UseLink);
--
the list archives: http://www.ListSearch.com/Lasso/Browse/
| From: Ke Carlton | Date Sent: 2010-08-01 15:30:26 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
Not quite, serialising an array of maps produces an error - I assume
this is what's silently failing when the vars are serialised for the
session and fail to stick. Everything else session wise is rocked
solid as far as I've tested. The only issues I've seen have been
logical - asides from the below:
array(map('a'=1),map('b'=2))->serialize;
FAILURE: 0 No error
Ke
On 1 August 2010 12:44, Steve Piercy - Web Site Builder
<Web@[Protected]> wrote:
>
> So it appears that serialization is functioning as it should, but something
> with the session manager is whacked where it just won't accept a map as an
> element of an array. I couldn't find anything in the Lasso 9 source that
> was relevant to sessions, so I hit a brick wall.
| From: Tami Williams | Date Sent: 2010-08-01 16:15:33 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
Exactly, the problem is that inserting MULTIPLE maps into 1 array var
that's serialized for the session fails with NO ERROR.
On Aug 1, 2010, at 6:30 PM, Ke Carlton wrote:
> Not quite, serialising an array of maps produces an error - I assume
> this is what's silently failing when the vars are serialised for the
> session and fail to stick. Everything else session wise is rocked
> solid as far as I've tested. The only issues I've seen have been
> logical - asides from the below:
>
> array(map('a'=1),map('b'=2))->serialize;
> FAILURE: 0 No error
>
> Ke
>
> On 1 August 2010 12:44, Steve Piercy - Web Site Builder
> <Web@[Protected]> wrote:
>>
>> So it appears that serialization is functioning as it should, but
>> something
>> with the session manager is whacked where it just won't accept a
>> map as an
>> element of an array. I couldn't find anything in the Lasso 9
>> source that
>> was relevant to sessions, so I hit a brick wall.
| From: Tami Williams | Date Sent: 2010-08-01 16:36:14 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
Rick
YES! That is very like my real sessions.inc. I also have code
elsewhere that sets default var values.
On Aug 1, 2010, at 3:58 PM, Rick Draper wrote:
> Hi Tami,
>
> It's possible to do what you want without adding the session vars on
> each
> page - I do the same as you and have a sessions.inc page. My logic
> is as
> follows and avoids setting sessions if its just a bot:
>
>
> If(lp_client_isBot);
> // set session variables to empty to avoid any errors
> Var('sv_User')='';
> //... Etc...
>
> Else;
> Session_Start(-Name=$Session_Name, -Expires=$Session_Duration,
> -UseAuto); // restart the session
> Var('Session_Result') = Session_Result;
> /If;
>
>
> If($Session_Result == 'new' || $Session_Result == 'expire');
> // If this is the start of the session, set the variables that will
> be used
>
> session_addvar(-name=$Session_Name,
> 'sv_User');
>
> // set the variables to their initial values
> Var('sv_User') = Map('User_ID' = $User_ID);
>
> /If;
>
> Very best regards,
>
> Rick
>
> -----Original Message-----
> From: Lasso Talk [mailto:lasso@[Protected]] On Behalf Of Tami
> Williams
> Sent: Sunday, 1 August 2010 8:57 PM
> To: Lasso Talk
> Subject: Re: lasso 9 problems with sessions - getting closer to an
> answer pt
> 2 DOWNLOAD LINK CORRECTION
>
> Steve:
>
> The reason my sample file has the session_start AND session_addVar
> on every
> page is that I wanted to replicate the way I code in real life where
> I have
> a file called sessions.inc that I include in every page in my site
> and in
> that file I do the session_start AND define all my session vars.
>
> So, all session var adds live in 1 file instead of being scattered
> across
> different files in my site.
>
> I've done this for as long as sessions have been available and had no
> problems.
>
>
> On Aug 1, 2010, at 4:52 AM, Steve Piercy - Web Site Builder wrote:
>
>> First, you don't need to do this on every page:
>>
>> Session_Start('TestSessionX', -Expires=15, -UseLink);
>> Session_AddVar('TestSessionX', 'testSessionVar');
>>
>> You need to do that only once, then on each subsequent page:
>>
>> Session_Start('TestSessionX', -Expires=15, -UseLink);
>
>
> --
> Search
> the list archives: http://www.ListSearch.com/Lasso/Browse/
| From: Steve Piercy - Web Site Builder | Date Sent: 2010-08-01 17:05:35 |
| Subject: Re: lasso 9 problems with sessions - getting closer to an answer pt 2 DOWNLOAD LINK CORRECTION | To: Lasso Talk |
| Navigation: First Message | Previous Message | Next Message | Last Message | |
Ah, OK. So I was looking too deeply in the source for
serialization.lasso. I assume that there is another block that
fails, because the serialization_writer block works fine.
There is a comment in there:
public asCopy() => self // map/set make a copy of their
keys. we don't want that
I guess we don't want that, whatever that means.
--steve
On 8/1/10 at 11:30 PM, ke@[Protected] (Ke Carlton) pronounced:
>Not quite, serialising an array of maps produces an error - I assume
>this is what's silently failing when the vars are serialised for the
>session and fail to stick. Everything else session wise is rocked
>solid as far as I've tested. The only issues I've seen have been
>logical - asides from the below:
>
>array(map('a'=1),map('b'=2))->serialize;
>FAILURE: 0 No error
>
>Ke
>
>On 1 August 2010 12:44, Steve Piercy - Web Site Builder
><Web@[Protected]> wrote:
>>
>>So it appears that serialization is functioning as it should, but something
>>with the session manager is whacked where it just won't accept a map as an
>>element of an array. I couldn't find anything in the Lasso 9 source that
>>was relevant to sessions, so I hit a brick wall.
>
>--
>
>
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy Web Site Builder
Soquel, CA
<web@[Protected]> <http://www.StevePiercy.com/>