Pragmatically tell if we are in debugging mode

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Dave, Jon, Steve, Ian

Segi
Ebase User
Posts: 623
Joined: Mon Dec 09, 2013 6:37 pm

Pragmatically tell if we are in debugging mode

#1

Postby Segi » Mon Jun 15, 2020 5:44 pm

I am using the debugging feature in 5.8 and it is working great. I've been experimenting with debugging against both the embedded server and our development server.

In all of my forms' before page event, I call a global function called verifyUserSession(applicationName); that verifies if the user is allowed to access the current application and if they are not logged in using the built in security system, it will redirect them to our Intranet login page.

This is exactly what I want under normal circumstances but if I want to debug a script, this causes a problem because Verj appears to start an entirely new session, even though I am already logged into our dev server (which is what I am currently debugging against) in another tab in Chrome and I am redirected to the login page. If I comment out the call to verifyUserSession(applicationName) I am able to debug interactively.

Is there a pragmatic way to detect if I am in debugging mode so I can not call verifyusersesion if I am in debugging mode ?

On a side note, I know that the breakpoints are added for all users, so I would write something like this to not call this method for me but continue to call it for everyone else:

Code: Select all

if (system.isDebugging == true && system.securityManager.getCredential("REALNAME") != "Segi") {
     verifyUserSession(applicationName);
}
0 x

Steve
Moderator
Moderator
Posts: 355
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

Re: Pragmatically tell if we are in debugging mode

#2

Postby Steve » Wed Jun 17, 2020 8:38 am

Hi Segi,

This is our first iteration for remote debugging so we are short of some features we'd like:

for example conditional breakpoints would help you where you could set

Code: Select all

if(system.securityManager.getCredential("REALNAME") != "Segi"))
on your breakpoint. But this is not available at the moment, but I think is on our roadmap for a later release.

I also like the idea of

Code: Select all

	system.isDebugging == true
If you are starting a session from the studio, it will automatically start a new session. If you type in the URL into the address bar of the browser, it should maintain the session until it times out.

Kind regards

Steve
0 x

Jon
Moderator
Moderator
Posts: 1322
Joined: Wed Sep 12, 2007 12:49 pm

Re: Pragmatically tell if we are in debugging mode

#3

Postby Jon » Fri Jun 19, 2020 1:16 pm

system.isDebugging() has been added in V5.9
0 x

Segi
Ebase User
Posts: 623
Joined: Mon Dec 09, 2013 6:37 pm

Re: Pragmatically tell if we are in debugging mode

#4

Postby Segi » Fri Jun 19, 2020 3:08 pm

Thanks. Glad to hear that this will be added in the next version
0 x


Who is online

Users browsing this forum: Bing [Bot] and 9 guests