NetTalk Central

Author Topic: NT8 "_screenWidth_" session value will contain zero after session delete  (Read 4346 times)

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Hi Bruce,
I see that in NT8, you revised the "getscreensize" JavaScript  to be more efficient by only updating the session value on server when the screen size has changed. Unfortunately, I (and I suspect others) have a problem with the new script because I delete the session after the user logs out which includes the _screenWidth_ session value. Thus when the user logs in again the _screenWidth_ session value contains zero because the “getscreensize” function does not know that the server session value was erased.  I use the _screenWidth_ session value to set the number of columns of my text box controls to fit my web pages.
For me, I solved the issue by clearing the JavaScript session storage on my log in web page which will trigger the "getscreensize" JavaScript  to update the server session variable. I added packet.append('sessionStorage._ScreenWidth_=0;') in the "7 Inside Script" embed. I wanted to let you know, but I am not sure how you can fix this issue generically for everyone and I hope that you keep the efficiency in the script.

Thanks,
Rob Kolanko
« Last Edit: November 23, 2014, 05:17:23 PM by Rob Kolanko »

Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: NT8 "_screenWidth_" session value will contain zero after session delete
« Reply #1 on: November 25, 2014, 12:22:33 PM »
I am using _screenHeight_ for calculating number of display rows in a browse. I found that few month ago it was working well but now mostly return 0. It was useful when it was working now we have fixed rows browse.

Best regards,

Djordje Radovanovic

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NT8 "_screenWidth_" session value will contain zero after session delete
« Reply #2 on: November 25, 2014, 10:08:25 PM »
Hi Djordje,

the function is still working, but it can be turned off completely in your app. So if it's "mostly returning 0" then I'm guessing someone has turned off the feature in your app.

Your issue is unrelated to Rob's I think.

cheers
Bruce


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NT8 "_screenWidth_" session value will contain zero after session delete
« Reply #3 on: November 25, 2014, 11:21:45 PM »
Rob,

I've tweaked 8.33 so that you can force it to update by using

p_web.script('getScreenSize(true)')

you'd put this in after the call to p_web.SetSessionLoggedIn(0).

cheers
Bruce

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: NT8 "_screenWidth_" session value will contain zero after session delete
« Reply #4 on: November 26, 2014, 08:44:43 AM »
Hi Djordje,

I think you may have the same problem, because you say "mostly return 0", which also can mean that it sometimes does work. Here is how to test. Start your browser fresh, not a new tab, but a cold start. Then connect to your web server program and log in. If your browse size does change (_screenHeight_ is returning a value), next log out and log back in and your browser size is not working  (_screenHeight_ is returns 0) then you have the same problem as me. You will have to add the code in Bruce's post.

Rob

Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: NT8 "_screenWidth_" session value will contain zero after session delete
« Reply #5 on: November 26, 2014, 11:31:13 PM »
Hi Bruce,

not one application. All applications have same problem. I do not know how to turn it on or off. I did not know that it is possible.

Best regards,

Djordje Radovanovic