[Zope] session data object question

Dvir Bar-lev dvir.b at puresight.com
Wed Mar 11 04:55:26 EDT 2009


I also tried to change the value of theButton key like so:

<dtml-if "REQUEST.has_key('submit')"> 
      <dtml-if "REQUEST.get('submit') == 'Login'">
            <dtml-call "REQUEST.set('submit', 'LoggedIn')">
      </dtml-if> 
   </dtml-if>

But if refresh the button it still thinks it has the value Login instead
of the value LoggedIn :(

-----Original Message-----
From: zope-bounces at zope.org [mailto:zope-bounces at zope.org] On Behalf Of
Dvir Bar-lev
Sent: Wednesday, March 11, 2009 10:33 AM
To: zope at zope.org
Subject: Re: [Zope] session data object question

Hi

I have a button like that but the the problem is that it also has this
value if I refresh the page, what I mean Is this, I put in the logged_in
page:

<dtml-if "Request.has_key('theButton')>
Do something
</dtml-if>

And it has the key even if I refresh the page.

I also tried to put <dtm-var theButton> to see if it keeps this value
after we refresh the page and it does.
What I need is a way to know if we loaded the page as a result of
pressing the button or as a result of refreshing the page, as I need to
do different things in each case.

-----Original Message-----
From: Andrew Milton [mailto:akm at theinternet.com.au] 
Sent: Wednesday, March 11, 2009 10:15 AM
To: Dvir Bar-lev
Cc: zope at zope.org
Subject: Re: [Zope] session data object question

+-------[ Dvir Bar-lev ]----------------------
| Hi
| 
|  
| 
| I was wondering if there is a way to connect the creation of a session
object
| to a button push.
| 
| I?ll explain in more detail:
| 
|  
| 
| I have a log in from called login_form, and I have a dtml method
called
| looged_in that is called when we push the submit button in the log in
form.
| 
| What I did is the following, in the log_in_form I get a session data
object
| only if it exsists and I check how much time passed and act
accordingly, in the
| looged_in method I create the data session oblject ans set the start
time.
| 
| Unfortuantly that is not good for me because if a user refreshes the
page it
| resets the time in the session object, I was wondering if there is a
way for me
| to know if I can reset the session data time only when the user clicks
the
| submit button and not as a result of a refresh call.

Name the submit button and check for the name of the button in the
request.

<input type="submit" name="theButton" value="Press Me">

"theButton" will appear in REQUEST (and REQUEST.form) if the button was
pressed.


-- 
Andrew Milton
akm at theinternet.com.au
_______________________________________________
Zope maillist  -  Zope at zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


More information about the Zope mailing list