Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set remember me always true or loggedin in grails?

How to set once user logged in, whenever user come back and visit a website ,user should be always logged in rather than asking for a log in until user clear a cookie.

Config Code :

grails.plugin.springsecurity.rememberMe.cookieName='xyz_remember_me'
grails.plugin.springsecurity.rememberMe.alwaysRemember=true //if true uses remember me even if no chkbox is in the form
grails.plugin.springsecurity.rememberMe.tokenValiditySeconds=31*24*60*60
grails.plugin.springsecurity.rememberMe.parameter='_spring_security_remember_me'
grails.plugin.springsecurity.rememberMe.key='xyzApp' // should be unique per application
grails.plugin.springsecurity.rememberMe.useSecureCookie=false

Gsp Code :

<input type='checkbox' class='chk' name='${rememberMeParameter}' id='remember_me' checked='checked'/>
like image 218
SAGAR MANE Avatar asked Feb 14 '23 01:02

SAGAR MANE


1 Answers

<input name="_spring_security_remember_me" type="hidden" value="true"/>

have you tried with an actual check box ? you could even default it to be checked

like image 188
Sandeep Sharma Avatar answered May 08 '23 07:05

Sandeep Sharma