Django : How can I implement a remember me key on my login page











up vote
-2
down vote

favorite












Actually rather than just code , I want to know all the topics I have to study for making a remember me key on my login page.
Its a inbuilt django login page and i have a bit knowledge of sessions and cache but not enough for making a remember me key and havent user caching yet.
If you can supply me with a answer or a source , that will be helpful










share|improve this question


























    up vote
    -2
    down vote

    favorite












    Actually rather than just code , I want to know all the topics I have to study for making a remember me key on my login page.
    Its a inbuilt django login page and i have a bit knowledge of sessions and cache but not enough for making a remember me key and havent user caching yet.
    If you can supply me with a answer or a source , that will be helpful










    share|improve this question
























      up vote
      -2
      down vote

      favorite









      up vote
      -2
      down vote

      favorite











      Actually rather than just code , I want to know all the topics I have to study for making a remember me key on my login page.
      Its a inbuilt django login page and i have a bit knowledge of sessions and cache but not enough for making a remember me key and havent user caching yet.
      If you can supply me with a answer or a source , that will be helpful










      share|improve this question













      Actually rather than just code , I want to know all the topics I have to study for making a remember me key on my login page.
      Its a inbuilt django login page and i have a bit knowledge of sessions and cache but not enough for making a remember me key and havent user caching yet.
      If you can supply me with a answer or a source , that will be helpful







      python django caching login web-deployment






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 22 at 12:52









      Jidnyesh

      75




      75
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          Just add a new field in your form like this:



          class LoginForm(forms.Form):
          username = forms.CharField()
          password = forms.CharField(widget= forms.PasswordInput)
          remember_me = forms.BoolenField()


          And update the view



          def login(request):
          if request.method == "POST":
          form = LoginForm(request.POST)
          if form.is_valid():
          username = form.cleaned_data['username']
          password = form.cleaned_data['password']
          remember_me = form.cleaned_data['remember_me']
          user = authenticated(username=username, password=password)
          if user:
          login(request, user)
          if not remember_me:
          request.session.set_expiry(0) # <-- Here if the remember me is False, that is why expiry is set to 0 seconds. So it will automatically close the session after the browser is closed.

          # else browser session will be as long as the session cookie time "SESSION_COOKIE_AGE"
          return redirect('/some/success/url')
          else:
          form = LoginForm()

          render(request, 'name.html', {'form': form})


          Update



          If you are using AuthenticationForm, then sub-class it like this:



          class LoginForm(AuthenticationForm):
          remember_me = forms.BooleanField() # and add the remember_me field


          And also sub-class your new view from LoginView. Also override the form_valid method inside the View.



          from django.contrib.auth import login as auth_login,


          class UpdatedLoginView(LoginView):
          form_class = LoginForm

          def form_valid(self, form):

          remember_me = form.cleaned_data['remember_me'] # get remember me data from cleaned_data of form
          if not remember_me:
          self.request.session.set_expiry(0) # if remember me is
          self.request.session.modified = True
          return super(UpdatedLoginView, self).form_valid(form)





          share|improve this answer























          • Rather than creating a whole new login view, can you tell me to extend the existing AuthenticationForm present in django.contrib.auth.forms in forms.py
            – Jidnyesh
            Nov 22 at 13:57












          • @Jidnyesh please see my updated answer.
            – ruddra
            Nov 22 at 14:21










          • And does this need to make changes in urls.py cause the login url contains views.login i.e default login , do i need to change all the redirects in my templates to UpdatedLoginView
            – Jidnyesh
            Nov 22 at 14:26










          • yes, you need to do that.
            – ruddra
            Nov 22 at 14:30










          • I implemented everything everyone suggested , i got a remember me key too and login is getting successful , Can you tell me how can i know if it is actully remembering me.
            – Jidnyesh
            Nov 22 at 15:05


















          up vote
          0
          down vote













          You can reference from this remember-me project:



          https://github.com/jimfmunro/django-remember-me



          and also a similar issue was solved in:
          Create 'remember me' feature in default django login view



          You need to set session expiry period:



          request.session.set_expiry(1209600) # 2 weeks


          Django sessions are set to 2 weeks (SESSION_COOKIE_AGE defaults to 1209600 seconds) and will not expire when the browser is closed (SESSION_EXPIRE_AT_BROWSER_CLOSE defaults to False)



          But if it's a must you set a remember me checkbox option with backend functions, then you can do the following on your Login custom form.



          remember_me = forms.BooleanField(required=False, widget=forms.CheckboxInput())

          if not self.cleaned_data.get('remember_me'):
          self.request.session.set_expiry(0)





          share|improve this answer























          • Actually i wanted to ask what changes to make in code to make remember me key works , like session and cache in detail.
            – Jidnyesh
            Nov 22 at 13:26










          • Im quite a starter therefore wanted prerequisites to do before adding remember me
            – Jidnyesh
            Nov 22 at 13:27










          • You will need to add the session expiry period for it to work after successful login credentials validation or when you are starting the user session
            – Mark Ochieng
            Nov 22 at 13:34












          • But i dont have a login view at all , where do you expect me to put this code , im just using built in django authentication , any way to extend the built in login django form
            – Jidnyesh
            Nov 22 at 13:59










          • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
            – hivert
            Nov 22 at 14:02











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53431476%2fdjango-how-can-i-implement-a-remember-me-key-on-my-login-page%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          Just add a new field in your form like this:



          class LoginForm(forms.Form):
          username = forms.CharField()
          password = forms.CharField(widget= forms.PasswordInput)
          remember_me = forms.BoolenField()


          And update the view



          def login(request):
          if request.method == "POST":
          form = LoginForm(request.POST)
          if form.is_valid():
          username = form.cleaned_data['username']
          password = form.cleaned_data['password']
          remember_me = form.cleaned_data['remember_me']
          user = authenticated(username=username, password=password)
          if user:
          login(request, user)
          if not remember_me:
          request.session.set_expiry(0) # <-- Here if the remember me is False, that is why expiry is set to 0 seconds. So it will automatically close the session after the browser is closed.

          # else browser session will be as long as the session cookie time "SESSION_COOKIE_AGE"
          return redirect('/some/success/url')
          else:
          form = LoginForm()

          render(request, 'name.html', {'form': form})


          Update



          If you are using AuthenticationForm, then sub-class it like this:



          class LoginForm(AuthenticationForm):
          remember_me = forms.BooleanField() # and add the remember_me field


          And also sub-class your new view from LoginView. Also override the form_valid method inside the View.



          from django.contrib.auth import login as auth_login,


          class UpdatedLoginView(LoginView):
          form_class = LoginForm

          def form_valid(self, form):

          remember_me = form.cleaned_data['remember_me'] # get remember me data from cleaned_data of form
          if not remember_me:
          self.request.session.set_expiry(0) # if remember me is
          self.request.session.modified = True
          return super(UpdatedLoginView, self).form_valid(form)





          share|improve this answer























          • Rather than creating a whole new login view, can you tell me to extend the existing AuthenticationForm present in django.contrib.auth.forms in forms.py
            – Jidnyesh
            Nov 22 at 13:57












          • @Jidnyesh please see my updated answer.
            – ruddra
            Nov 22 at 14:21










          • And does this need to make changes in urls.py cause the login url contains views.login i.e default login , do i need to change all the redirects in my templates to UpdatedLoginView
            – Jidnyesh
            Nov 22 at 14:26










          • yes, you need to do that.
            – ruddra
            Nov 22 at 14:30










          • I implemented everything everyone suggested , i got a remember me key too and login is getting successful , Can you tell me how can i know if it is actully remembering me.
            – Jidnyesh
            Nov 22 at 15:05















          up vote
          1
          down vote













          Just add a new field in your form like this:



          class LoginForm(forms.Form):
          username = forms.CharField()
          password = forms.CharField(widget= forms.PasswordInput)
          remember_me = forms.BoolenField()


          And update the view



          def login(request):
          if request.method == "POST":
          form = LoginForm(request.POST)
          if form.is_valid():
          username = form.cleaned_data['username']
          password = form.cleaned_data['password']
          remember_me = form.cleaned_data['remember_me']
          user = authenticated(username=username, password=password)
          if user:
          login(request, user)
          if not remember_me:
          request.session.set_expiry(0) # <-- Here if the remember me is False, that is why expiry is set to 0 seconds. So it will automatically close the session after the browser is closed.

          # else browser session will be as long as the session cookie time "SESSION_COOKIE_AGE"
          return redirect('/some/success/url')
          else:
          form = LoginForm()

          render(request, 'name.html', {'form': form})


          Update



          If you are using AuthenticationForm, then sub-class it like this:



          class LoginForm(AuthenticationForm):
          remember_me = forms.BooleanField() # and add the remember_me field


          And also sub-class your new view from LoginView. Also override the form_valid method inside the View.



          from django.contrib.auth import login as auth_login,


          class UpdatedLoginView(LoginView):
          form_class = LoginForm

          def form_valid(self, form):

          remember_me = form.cleaned_data['remember_me'] # get remember me data from cleaned_data of form
          if not remember_me:
          self.request.session.set_expiry(0) # if remember me is
          self.request.session.modified = True
          return super(UpdatedLoginView, self).form_valid(form)





          share|improve this answer























          • Rather than creating a whole new login view, can you tell me to extend the existing AuthenticationForm present in django.contrib.auth.forms in forms.py
            – Jidnyesh
            Nov 22 at 13:57












          • @Jidnyesh please see my updated answer.
            – ruddra
            Nov 22 at 14:21










          • And does this need to make changes in urls.py cause the login url contains views.login i.e default login , do i need to change all the redirects in my templates to UpdatedLoginView
            – Jidnyesh
            Nov 22 at 14:26










          • yes, you need to do that.
            – ruddra
            Nov 22 at 14:30










          • I implemented everything everyone suggested , i got a remember me key too and login is getting successful , Can you tell me how can i know if it is actully remembering me.
            – Jidnyesh
            Nov 22 at 15:05













          up vote
          1
          down vote










          up vote
          1
          down vote









          Just add a new field in your form like this:



          class LoginForm(forms.Form):
          username = forms.CharField()
          password = forms.CharField(widget= forms.PasswordInput)
          remember_me = forms.BoolenField()


          And update the view



          def login(request):
          if request.method == "POST":
          form = LoginForm(request.POST)
          if form.is_valid():
          username = form.cleaned_data['username']
          password = form.cleaned_data['password']
          remember_me = form.cleaned_data['remember_me']
          user = authenticated(username=username, password=password)
          if user:
          login(request, user)
          if not remember_me:
          request.session.set_expiry(0) # <-- Here if the remember me is False, that is why expiry is set to 0 seconds. So it will automatically close the session after the browser is closed.

          # else browser session will be as long as the session cookie time "SESSION_COOKIE_AGE"
          return redirect('/some/success/url')
          else:
          form = LoginForm()

          render(request, 'name.html', {'form': form})


          Update



          If you are using AuthenticationForm, then sub-class it like this:



          class LoginForm(AuthenticationForm):
          remember_me = forms.BooleanField() # and add the remember_me field


          And also sub-class your new view from LoginView. Also override the form_valid method inside the View.



          from django.contrib.auth import login as auth_login,


          class UpdatedLoginView(LoginView):
          form_class = LoginForm

          def form_valid(self, form):

          remember_me = form.cleaned_data['remember_me'] # get remember me data from cleaned_data of form
          if not remember_me:
          self.request.session.set_expiry(0) # if remember me is
          self.request.session.modified = True
          return super(UpdatedLoginView, self).form_valid(form)





          share|improve this answer














          Just add a new field in your form like this:



          class LoginForm(forms.Form):
          username = forms.CharField()
          password = forms.CharField(widget= forms.PasswordInput)
          remember_me = forms.BoolenField()


          And update the view



          def login(request):
          if request.method == "POST":
          form = LoginForm(request.POST)
          if form.is_valid():
          username = form.cleaned_data['username']
          password = form.cleaned_data['password']
          remember_me = form.cleaned_data['remember_me']
          user = authenticated(username=username, password=password)
          if user:
          login(request, user)
          if not remember_me:
          request.session.set_expiry(0) # <-- Here if the remember me is False, that is why expiry is set to 0 seconds. So it will automatically close the session after the browser is closed.

          # else browser session will be as long as the session cookie time "SESSION_COOKIE_AGE"
          return redirect('/some/success/url')
          else:
          form = LoginForm()

          render(request, 'name.html', {'form': form})


          Update



          If you are using AuthenticationForm, then sub-class it like this:



          class LoginForm(AuthenticationForm):
          remember_me = forms.BooleanField() # and add the remember_me field


          And also sub-class your new view from LoginView. Also override the form_valid method inside the View.



          from django.contrib.auth import login as auth_login,


          class UpdatedLoginView(LoginView):
          form_class = LoginForm

          def form_valid(self, form):

          remember_me = form.cleaned_data['remember_me'] # get remember me data from cleaned_data of form
          if not remember_me:
          self.request.session.set_expiry(0) # if remember me is
          self.request.session.modified = True
          return super(UpdatedLoginView, self).form_valid(form)






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 24 at 14:42

























          answered Nov 22 at 13:24









          ruddra

          10.5k32547




          10.5k32547












          • Rather than creating a whole new login view, can you tell me to extend the existing AuthenticationForm present in django.contrib.auth.forms in forms.py
            – Jidnyesh
            Nov 22 at 13:57












          • @Jidnyesh please see my updated answer.
            – ruddra
            Nov 22 at 14:21










          • And does this need to make changes in urls.py cause the login url contains views.login i.e default login , do i need to change all the redirects in my templates to UpdatedLoginView
            – Jidnyesh
            Nov 22 at 14:26










          • yes, you need to do that.
            – ruddra
            Nov 22 at 14:30










          • I implemented everything everyone suggested , i got a remember me key too and login is getting successful , Can you tell me how can i know if it is actully remembering me.
            – Jidnyesh
            Nov 22 at 15:05


















          • Rather than creating a whole new login view, can you tell me to extend the existing AuthenticationForm present in django.contrib.auth.forms in forms.py
            – Jidnyesh
            Nov 22 at 13:57












          • @Jidnyesh please see my updated answer.
            – ruddra
            Nov 22 at 14:21










          • And does this need to make changes in urls.py cause the login url contains views.login i.e default login , do i need to change all the redirects in my templates to UpdatedLoginView
            – Jidnyesh
            Nov 22 at 14:26










          • yes, you need to do that.
            – ruddra
            Nov 22 at 14:30










          • I implemented everything everyone suggested , i got a remember me key too and login is getting successful , Can you tell me how can i know if it is actully remembering me.
            – Jidnyesh
            Nov 22 at 15:05
















          Rather than creating a whole new login view, can you tell me to extend the existing AuthenticationForm present in django.contrib.auth.forms in forms.py
          – Jidnyesh
          Nov 22 at 13:57






          Rather than creating a whole new login view, can you tell me to extend the existing AuthenticationForm present in django.contrib.auth.forms in forms.py
          – Jidnyesh
          Nov 22 at 13:57














          @Jidnyesh please see my updated answer.
          – ruddra
          Nov 22 at 14:21




          @Jidnyesh please see my updated answer.
          – ruddra
          Nov 22 at 14:21












          And does this need to make changes in urls.py cause the login url contains views.login i.e default login , do i need to change all the redirects in my templates to UpdatedLoginView
          – Jidnyesh
          Nov 22 at 14:26




          And does this need to make changes in urls.py cause the login url contains views.login i.e default login , do i need to change all the redirects in my templates to UpdatedLoginView
          – Jidnyesh
          Nov 22 at 14:26












          yes, you need to do that.
          – ruddra
          Nov 22 at 14:30




          yes, you need to do that.
          – ruddra
          Nov 22 at 14:30












          I implemented everything everyone suggested , i got a remember me key too and login is getting successful , Can you tell me how can i know if it is actully remembering me.
          – Jidnyesh
          Nov 22 at 15:05




          I implemented everything everyone suggested , i got a remember me key too and login is getting successful , Can you tell me how can i know if it is actully remembering me.
          – Jidnyesh
          Nov 22 at 15:05












          up vote
          0
          down vote













          You can reference from this remember-me project:



          https://github.com/jimfmunro/django-remember-me



          and also a similar issue was solved in:
          Create 'remember me' feature in default django login view



          You need to set session expiry period:



          request.session.set_expiry(1209600) # 2 weeks


          Django sessions are set to 2 weeks (SESSION_COOKIE_AGE defaults to 1209600 seconds) and will not expire when the browser is closed (SESSION_EXPIRE_AT_BROWSER_CLOSE defaults to False)



          But if it's a must you set a remember me checkbox option with backend functions, then you can do the following on your Login custom form.



          remember_me = forms.BooleanField(required=False, widget=forms.CheckboxInput())

          if not self.cleaned_data.get('remember_me'):
          self.request.session.set_expiry(0)





          share|improve this answer























          • Actually i wanted to ask what changes to make in code to make remember me key works , like session and cache in detail.
            – Jidnyesh
            Nov 22 at 13:26










          • Im quite a starter therefore wanted prerequisites to do before adding remember me
            – Jidnyesh
            Nov 22 at 13:27










          • You will need to add the session expiry period for it to work after successful login credentials validation or when you are starting the user session
            – Mark Ochieng
            Nov 22 at 13:34












          • But i dont have a login view at all , where do you expect me to put this code , im just using built in django authentication , any way to extend the built in login django form
            – Jidnyesh
            Nov 22 at 13:59










          • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
            – hivert
            Nov 22 at 14:02















          up vote
          0
          down vote













          You can reference from this remember-me project:



          https://github.com/jimfmunro/django-remember-me



          and also a similar issue was solved in:
          Create 'remember me' feature in default django login view



          You need to set session expiry period:



          request.session.set_expiry(1209600) # 2 weeks


          Django sessions are set to 2 weeks (SESSION_COOKIE_AGE defaults to 1209600 seconds) and will not expire when the browser is closed (SESSION_EXPIRE_AT_BROWSER_CLOSE defaults to False)



          But if it's a must you set a remember me checkbox option with backend functions, then you can do the following on your Login custom form.



          remember_me = forms.BooleanField(required=False, widget=forms.CheckboxInput())

          if not self.cleaned_data.get('remember_me'):
          self.request.session.set_expiry(0)





          share|improve this answer























          • Actually i wanted to ask what changes to make in code to make remember me key works , like session and cache in detail.
            – Jidnyesh
            Nov 22 at 13:26










          • Im quite a starter therefore wanted prerequisites to do before adding remember me
            – Jidnyesh
            Nov 22 at 13:27










          • You will need to add the session expiry period for it to work after successful login credentials validation or when you are starting the user session
            – Mark Ochieng
            Nov 22 at 13:34












          • But i dont have a login view at all , where do you expect me to put this code , im just using built in django authentication , any way to extend the built in login django form
            – Jidnyesh
            Nov 22 at 13:59










          • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
            – hivert
            Nov 22 at 14:02













          up vote
          0
          down vote










          up vote
          0
          down vote









          You can reference from this remember-me project:



          https://github.com/jimfmunro/django-remember-me



          and also a similar issue was solved in:
          Create 'remember me' feature in default django login view



          You need to set session expiry period:



          request.session.set_expiry(1209600) # 2 weeks


          Django sessions are set to 2 weeks (SESSION_COOKIE_AGE defaults to 1209600 seconds) and will not expire when the browser is closed (SESSION_EXPIRE_AT_BROWSER_CLOSE defaults to False)



          But if it's a must you set a remember me checkbox option with backend functions, then you can do the following on your Login custom form.



          remember_me = forms.BooleanField(required=False, widget=forms.CheckboxInput())

          if not self.cleaned_data.get('remember_me'):
          self.request.session.set_expiry(0)





          share|improve this answer














          You can reference from this remember-me project:



          https://github.com/jimfmunro/django-remember-me



          and also a similar issue was solved in:
          Create 'remember me' feature in default django login view



          You need to set session expiry period:



          request.session.set_expiry(1209600) # 2 weeks


          Django sessions are set to 2 weeks (SESSION_COOKIE_AGE defaults to 1209600 seconds) and will not expire when the browser is closed (SESSION_EXPIRE_AT_BROWSER_CLOSE defaults to False)



          But if it's a must you set a remember me checkbox option with backend functions, then you can do the following on your Login custom form.



          remember_me = forms.BooleanField(required=False, widget=forms.CheckboxInput())

          if not self.cleaned_data.get('remember_me'):
          self.request.session.set_expiry(0)






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 22 at 14:13

























          answered Nov 22 at 13:14









          Mark Ochieng

          12




          12












          • Actually i wanted to ask what changes to make in code to make remember me key works , like session and cache in detail.
            – Jidnyesh
            Nov 22 at 13:26










          • Im quite a starter therefore wanted prerequisites to do before adding remember me
            – Jidnyesh
            Nov 22 at 13:27










          • You will need to add the session expiry period for it to work after successful login credentials validation or when you are starting the user session
            – Mark Ochieng
            Nov 22 at 13:34












          • But i dont have a login view at all , where do you expect me to put this code , im just using built in django authentication , any way to extend the built in login django form
            – Jidnyesh
            Nov 22 at 13:59










          • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
            – hivert
            Nov 22 at 14:02


















          • Actually i wanted to ask what changes to make in code to make remember me key works , like session and cache in detail.
            – Jidnyesh
            Nov 22 at 13:26










          • Im quite a starter therefore wanted prerequisites to do before adding remember me
            – Jidnyesh
            Nov 22 at 13:27










          • You will need to add the session expiry period for it to work after successful login credentials validation or when you are starting the user session
            – Mark Ochieng
            Nov 22 at 13:34












          • But i dont have a login view at all , where do you expect me to put this code , im just using built in django authentication , any way to extend the built in login django form
            – Jidnyesh
            Nov 22 at 13:59










          • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
            – hivert
            Nov 22 at 14:02
















          Actually i wanted to ask what changes to make in code to make remember me key works , like session and cache in detail.
          – Jidnyesh
          Nov 22 at 13:26




          Actually i wanted to ask what changes to make in code to make remember me key works , like session and cache in detail.
          – Jidnyesh
          Nov 22 at 13:26












          Im quite a starter therefore wanted prerequisites to do before adding remember me
          – Jidnyesh
          Nov 22 at 13:27




          Im quite a starter therefore wanted prerequisites to do before adding remember me
          – Jidnyesh
          Nov 22 at 13:27












          You will need to add the session expiry period for it to work after successful login credentials validation or when you are starting the user session
          – Mark Ochieng
          Nov 22 at 13:34






          You will need to add the session expiry period for it to work after successful login credentials validation or when you are starting the user session
          – Mark Ochieng
          Nov 22 at 13:34














          But i dont have a login view at all , where do you expect me to put this code , im just using built in django authentication , any way to extend the built in login django form
          – Jidnyesh
          Nov 22 at 13:59




          But i dont have a login view at all , where do you expect me to put this code , im just using built in django authentication , any way to extend the built in login django form
          – Jidnyesh
          Nov 22 at 13:59












          While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
          – hivert
          Nov 22 at 14:02




          While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
          – hivert
          Nov 22 at 14:02


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53431476%2fdjango-how-can-i-implement-a-remember-me-key-on-my-login-page%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          What visual should I use to simply compare current year value vs last year in Power BI desktop

          Alexandru Averescu

          Trompette piccolo