Re: Question about SET and GET WEB OPTIONS

2017-03-05 Thread Kirk Brooks via 4D_Tech
OK, I think I have a better handle on this now. Someone please correct me
if I'm wrong. If you read the docs carefully you notice it says:

The WEB SET OPTION command modifies the current value of various options
concerning the functioning of the 4D Web server. link



And I came across a tech tip  explaining
how to programmatically manage using automatic sessions which says:

This method will not change the database settings and only applies to the
session.

By 'session' it seems we mean 'since the database was started' since the
example stops the web server, makes changes, then starts it again.

This may be specifically talking about this particular option but it's the
same behavior I'm seeing. So I'm concluding the options I'm looking at
aren't changed in the database settings (hence don't show up on the
settings form) and would have to be applied each time 4D server starts up.

Anyone else have any ideas here?

And on a related note - if I set the session timeout to something long, say
3 days, and the process timeout to something like an hour (so I don't have
a bunch of idle web processes hanging out) I can use the On web session
suspend command to save the session parameters when the PROCESS closes
down. But how do I know that particular SESSION is resuming?

Tim Penner wrote a really good tech note 
demonstrating how to use cookies to track validating web sessions. But it
stops short of discussing this. In his example it seems like the approach
would be to save the web process data with the validated user record -
which is fine if you only allow one session per user, I suppose. But in
that case it seems like I'm going to be managing session expiration instead
of whatever the 4D mechanism is - in which case why do I actually care what
4D's session timeout is?


On Sun, Mar 5, 2017 at 3:19 PM, Kirk Brooks  wrote:

>
> When I moved on to writing a setter method. I notice some options either
> don't change or the database settings panel shows different values.
> Specifically Web inactive process timeout.
>
> I can use WEB SET OPTION to set a value and that value is returned if I
> use my get options method. But if I go to the actual server and look at the
> same setting in the settings form it's different. And if I change the value
> there it doesn't reflect in my get options method.
>
-- 
Kirk Brooks
San Francisco, CA
===
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Question about SET and GET WEB OPTIONS

2017-03-05 Thread Kirk Brooks via 4D_Tech
Hi John,
Thanks for the info. I wonder if it has something to do with the sliders on
the sb settings form that constrict your choices while WEB SET OPTION
appears to allow setting that value to any number.

Where is the Web inactive session time in the db settings? I am only able
to find the process timeout.

On Sun, Mar 5, 2017 at 5:22 PM, John DeSoi via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> Hi Kirk,
>
> > On Mar 5, 2017, at 5:19 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > When I moved on to writing a setter method. I notice some options either
> > don't change or the database settings panel shows different values.
> > Specifically Web inactive process timeout.
>
> I have these comments in my web server startup code:
>
>   //15.1 bug: These options can only be set in the database settings.
>   //WEB SET OPTION(Web inactive process timeout;0)  //Default is 480
> minutes.
>   //WEB SET OPTION(Web inactive session timeout;0)  //Must be set before
> the server is started.
>
>
> If I recall correctly, someone from 4D confirmed this as a bug when I
> mentioned it. I assumed it would have been fixed by now, but perhaps not. I
> have not retested it with the latest release.
>
> John DeSoi, Ph.D.
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>



-- 
Kirk Brooks
San Francisco, CA
===
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Question about SET and GET WEB OPTIONS

2017-03-05 Thread John DeSoi via 4D_Tech
Hi Kirk,

> On Mar 5, 2017, at 5:19 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> When I moved on to writing a setter method. I notice some options either
> don't change or the database settings panel shows different values.
> Specifically Web inactive process timeout.

I have these comments in my web server startup code:

  //15.1 bug: These options can only be set in the database settings.
  //WEB SET OPTION(Web inactive process timeout;0)  //Default is 480 minutes.
  //WEB SET OPTION(Web inactive session timeout;0)  //Must be set before the 
server is started.


If I recall correctly, someone from 4D confirmed this as a bug when I mentioned 
it. I assumed it would have been fixed by now, but perhaps not. I have not 
retested it with the latest release.

John DeSoi, Ph.D.

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Question about SET and GET WEB OPTIONS

2017-03-05 Thread Kirk Brooks via 4D_Tech
I've been working with the web server in v15.4 and playing with WEB SET
OPTION and WEB GET OPTION.

I wrote a method to retrieve a list of settings from the server. The method
executes on the server and stores the options in a c-obj. I changed some
things on the server and the changes were reflected the next time I ran the
method. Worked fine.

When I moved on to writing a setter method. I notice some options either
don't change or the database settings panel shows different values.
Specifically Web inactive process timeout.

I can use WEB SET OPTION to set a value and that value is returned if I use
my get options method. But if I go to the actual server and look at the
same setting in the settings form it's different. And if I change the value
there it doesn't reflect in my get options method.

I tried restarting the web server when making changes but that didn't seem
to matter.

So, I must be confused about some aspect of this. Here's hoping someone can
point me in the right direction.

FYI - here are the methods I'm using;

  //  Web_GET_serverOptions  ** EOS **
  // Written by: Kirk as Designer, Created: 03/05/17, 14:08:02
  // --
  // Method: Web_GET_serverOptions (pointer)
  // $1 is pointer to c-obj for options
  // Purpose: get the web server options from the server

C_POINTER($1)
C_LONGINT($i)
C_TEXT($text)
C_OBJECT($obj)

$obj:=JSON Parse("{}")

WEB GET OPTION(0;$i)
OB SET($obj;"wdl-disable";$i)

WEB GET OPTION(wdl enable with all body parts;$i)
OB SET($obj;"wdl-enable-with-all-body-parts";$i)

WEB GET OPTION(wdl enable with request body;$i)
OB SET($obj;"wdl-enable-with-request-body";$i)

WEB GET OPTION(wdl enable with response body;$i)
OB SET($obj;"wdl-enable-with-response-body";$i)

WEB GET OPTION(wdl enable without body;$i)
OB SET($obj;"wdl-enable-without-body";$i)

WEB GET OPTION(Web character set;$text)
OB SET($obj;"Web-character-set";$text)

WEB GET OPTION(Web debug log;$i)
OB SET($obj;"Web-debug-log";$i)

WEB GET OPTION(Web HTTP compression level;$i)
OB SET($obj;"Web-HTTP-compression-level";$i)

WEB GET OPTION(Web HTTP compression threshold;$i)
OB SET($obj;"Web-HTTP-compression-threshold";$i)

WEB GET OPTION(Web HTTPS port ID;$i)
OB SET($obj;"Web-HTTPS-port-ID";$i)

WEB GET OPTION(Web inactive process timeout;$i)
OB SET($obj;"Web-inactive-process-timeout";$i)

WEB GET OPTION(Web inactive session timeout;$i)
OB SET($obj;"Web-inactive-session-timeout";$i)

WEB GET OPTION(Web IP address to listen;$text)
OB SET($obj;"Web-IP-address-to-listen";$text)

WEB GET OPTION(Web keep session;$i)
OB SET($obj;"Web-keep-session";$i)

WEB GET OPTION(Web log recording;$i)
OB SET($obj;"Web-log-recording";$i)

WEB GET OPTION(Web max concurrent processes;$i)
OB SET($obj;"Web-max-concurrent-processes";$i)

WEB GET OPTION(Web max sessions;$i)
OB SET($obj;"Web-max-sessions";$i)

WEB GET OPTION(Web maximum requests size;$i)
OB SET($obj;"Web-maximum-requests-size";$i)

WEB GET OPTION(Web Port ID;$i)
OB SET($obj;"Web-port-ID";$i)

WEB GET OPTION(Web Session cookie domain;$text)
OB SET($obj;"Web-session-cookie-domain";$text)

WEB GET OPTION(Web session cookie name;$text)
OB SET($obj;"Web-session-cookie-name";$text)

WEB GET OPTION(Web Session cookie path;$text)
OB SET($obj;"Web-session-cookie-path";$text)

WEB GET OPTION(Web Session enable IP address validation;$i)
OB SET($obj;"Web-session-enable-IP-address-validation";$i)

$1->:=$obj
/

  //  Web_SET_serverOptions ** EOS **
  // Written by: Kirk as Designer, Created: 03/05/17, 14:39:20
  // --
  // Method: Web_SET_serverOptions (pointer)
  // $1 is obj of server opitons
  // Purpose:

C_POINTER($1)
C_LONGINT($i)
C_TEXT($text)
C_OBJECT($obj)

$obj:=JSON Parse("{}")
$obj:=OB Copy($1->)

  // 
If (OB Is defined($obj;"wdl-disable"))
$i:=OB Get($obj;"wdl-disable")
WEB SET OPTION(0;$i)
End if

If (OB Is defined($obj;"wdl-enable-with-all-body-parts"))
$i:=OB Get($obj;"wdl-enable-with-all-body-parts")
WEB SET OPTION(wdl enable with all body parts;$i)
End if

If (OB Is defined($obj;"wdl-enable-with-request-body"))
$i:=OB Get($obj;"wdl-enable-with-request-body")
WEB SET OPTION(wdl enable with request body;$i)
End if

If (OB Is defined($obj;"wdl-enable-with-response-body"))
$i:=OB Get($obj;"wdl-enable-with-response-body")
WEB SET OPTION(wdl enable with response body;$i)
End if

If (OB Is defined($obj;"wdl-enable-without-body"))
$i:=OB Get($obj;"wdl-enable-without-body")
WEB SET OPTION(wdl enable without body;$i)
End if

If (OB Is defined($obj;"Web-character-set"))
$text:=OB Get($obj;"Web-character-set")
WEB SET OPTION(Web character set;$text)
End if

If (OB Is defined($obj;"Web-debug-log"))
$i:=OB Get($obj;"Web-debug-log")
WEB SET OPTION(Web debug log;$i)
End if

If (OB Is defined($obj;"Web-HTTP-compression-level"))
$i:=OB Get($obj;"Web-HTTP-compression-level")
WEB SET OPTION(Web HTTP compression level;$i)
End if

If (OB Is defined($obj;"Web-HTTP-compression-

Re: Please vote for this feature request: Raise the 31 character limit

2017-03-05 Thread David Adams via 4D_Tech
>
>
> ​uh... Do you mean for variable names?  nah... no thanks. Can't
> remember the last time I felt constrained by a 31 char limit. In fact,
> reading code with a bunch of variable names approaching 20 char makes my
> blood pressure go up.​


My main problem is method names, although others have asked for longer
variable names and I've got nothing against them either. I make more
methods than variables.

For more details, see the thread:

http://forums.4d.fr/Post/EN/18946884/0/0/

The worst for me is meaningless variable names. The
> next worst thing for me is really long variable names that could use some
> smart concise editing that retains meaning with readability.
>

We all hate meaningless names, so no argument there. As to why 31
characters is not enough, it's because some (a lot?) of us use part of the
name to create a pseudo-namespace prefix. That burns up a lot of characters
but brings huge benefits. So, the remaining character limit (in my case) is
20 characters already
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Please vote for this feature request: Raise the 31 character limit

2017-03-05 Thread steve simpson via 4D_Tech
On Sun, Mar 5, 2017 at 3:00 PM,
​David Adams
 wrote:

> Please vote for this feature request: Raise the 31 character
>   limit (David Adams)
>

​uh... Do you mean for variable names?  nah... no thanks. Can't
remember the last time I felt constrained by a 31 char limit. In fact,
reading code with a bunch of variable names approaching 20 char makes my
blood pressure go up.​ The worst for me is meaningless variable names. The
next worst thing for me is really long variable names that could use some
smart concise editing that retains meaning with readability.


Steve Simpson
​Cimarron Software
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**