Developer forum

Forum » Templates » Futile attempt to utilize the autologin functionality

Futile attempt to utilize the autologin functionality

Roald Haahr Jensen
Reply

Hi

I am trying to make a login form which should autologin. However, when I login with the autologin box ticked, I am still prompted to login when I access the site the next time I open the same browser. It does fill in the username and password used for the last login, though.

The code i use is:

<form name="ExtUserForm" method="post" Action="<!--@DWExtranetAction-->" onSubmit="return checkform();">
    <input name="DWExtranetUsernameRemember" type="hidden" value="True" />
    <input name="DWExtranetPasswordRemember" type="hidden" value="True" />
    <input type="text" tabindex="1" class="form-control" name="Username" value="<!--@DWExtranetUsername-->" placeholder="Brugernavn" />
    <input type="password" tabindex="2" class="form-control" name="Password" placeholder="Adgangskode" value="<!--@DWExtranetPassword-->" />
    <input type="checkbox" value="true" name="Autologin" id="autologin" class="form-check login-checkboks"><label for="autologin">Husk mig</label>
    <button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#glemtpassword">Hjælp</button>
    <button type="submit" class="btn btn-primary" tabindex="3" name="LoginAction" value="Login">Log på</button>
</form>
 
How do I fix it? Is there some case mismatch that I am not seeing?
 
/ Roald

Replies

 
Nicolai Pedersen
Reply

It looks right

  1. Check the cookie that the system sets that it looks ok. It should be named "DW_Extranet" and look like this:
    DWExtranetUsername=np&DWExtranetPassword=asdfasdfasdg==&AL=True
  2. Check the expiration of the cookie - you can set that from the backend, in settings section. Default is 30 days - if you set it to 0, that also means 30 days
  3. What happens in checkform javascript method? Does it change anything on the form - or change the action to get?

This site use this feature - and it seems to work.

Also try to take a look at the post in the browser developer tools - and see if the post looks ok and the cookie gets responsed correctly

BR Nicolai

 

You must be logged in to post in the forum