NetTalk Central

Author Topic: Example 3, remember login, does not delete cookies  (Read 4019 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Example 3, remember login, does not delete cookies
« on: March 31, 2012, 05:42:41 AM »
Hi,
In the example 3, you can use the remember me check to remember login usu and pass as cookies.
If you uncheck the remember me check box the loc:remember variable does not change, it is allways 1 and then you cannot forget the usu and pass remembered.
Theres no way to delete the cookies.
I´ve tried severan workarrounds but nothing worked.
Any Idea?
THanks

-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Example 3, remember login, does not delete cookies
« Reply #1 on: April 01, 2012, 11:37:22 PM »
Hi Alberto,

which build are you using? In the current shipping builds example 3 doesn't have a "remember me" checkbox.

If you wizard up a simple app, then the Loginform procedure there does have a "Remember me" checkbox, and it seems to work (ie if it's off, the cookies are deleted, once the person logs in of course.)

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Example 3, remember login, does not delete cookies
« Reply #2 on: April 02, 2012, 10:39:25 AM »
I´using 5.48
attached goes the resulting web page from example 3 of 5.48
if I´m wrong and theres another example...
may you please post the code in  the accepted login form?


[attachment deleted by admin]
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Example 3, remember login, does not delete cookies
« Reply #3 on: April 02, 2012, 11:55:05 PM »
Hi Alberto,

I fired up example 3, from NetTalk 5 here and gave it a try.
I logged in with demo, Demo, and the remember me turned on.

Any request after that then includes the following in the header (you can see this in the log)
Cookie: SESSIONID=828890677; LOC__LOGIN=demo; LOC__PASSWORD=demo

this is expected (and part of what "remember me" does).

Then I logout (which brings me back to the login screen) - I log in as Demo, demo, but this time I leave the "remember me" off.

After that,
Cookie: SESSIONID=828890677

So, it looks to me like the DeleteCookie thing seems to be working ok.

did I go wrong in the process somewhere?

cheers
Bruce


Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Example 3, remember login, does not delete cookies
« Reply #4 on: April 03, 2012, 02:28:14 AM »
What you do is OK but.. if you want to be remebered, you need to check the remember me checkbox every time you loged in.
-Log in as demo demo and check the remember.
-Next time you want to log in the usu and pass are remembered but the check is not.
-The user press the login button, happy that the usu and pass were remebered but does not check again the remeber check
-Next time usu and pass are not remembered
The idea is that if the user checks the first time de remember check the user and pass are always remebered till the user uncheck it.
I tryed adding the loc__remember cookie but if I do so, the loc:remeber are allways checked.
How can it be done?
and why does the browser not to offer to remeber the usu and pass? like it does with other noy NT5 servers?
Thanks
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Example 3, remember login, does not delete cookies
« Reply #5 on: April 03, 2012, 04:04:47 AM »
yeah, the "not remembering" is deliberate in that example.

If you want it to remember the checkbox as well, then you need to be a bit cunning, because of the way HTML does checkboxes in a Post. (The reasons are technical, and boring.)

so, duplicate the lines for SetCookie and DeleteCookie, but set the cookie name to say just Remember, not loc__remember.

Then on the priming tab, prime the loc:remember firld to
p_web.GetValue('remember')
Also be sure to tick on "Prime for change".

cheers
Bruce