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

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

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:a...@theinternet.com.au] 
Sent: Wednesday, March 11, 2009 10:15 AM
To: Dvir Bar-lev
Cc: zope@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
| 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
| looged_in that is called when we push the submit button in the log in
| What I did is the following, in the log_in_form I get a session data
| 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
| 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
| 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

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

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

Andrew Milton
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to