aspose file tools*
The moose likes JSP and the fly likes Remember Me Functionality Implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Remember Me Functionality Implementation" Watch "Remember Me Functionality Implementation" New topic
Author

Remember Me Functionality Implementation

Vaibhav G Garg
Ranch Hand

Joined: Sep 23, 2011
Posts: 134
I have to implement Remember Me Functionality in a web application. Please provide inputs to achieve the same. Also, if the cookies are disabled then what is the alternative so that if the user comes after 4-5 days, he is automatically logged in to the system when he hits the web site url.
harshvardhan ojha
Ranch Hand

Joined: Jul 26, 2007
Posts: 157
    
    1

Vaibhav, use cookies for remember me and single sign on. I am not very sure but you can also use client IP to identify and validate him.
Vaibhav G Garg
Ranch Hand

Joined: Sep 23, 2011
Posts: 134
harshvardhan ojha wrote:Vaibhav, use cookies for remember me and single sign on. I am not very sure but you can also use client IP to identify and validate him.


Thanks for your inputs Harshvardhan. But, generally the IP gets allocated dynamically and hence, it will be different each and every time.
harshvardhan ojha
Ranch Hand

Joined: Jul 26, 2007
Posts: 157
    
    1

then the only option you are left with is cookies, BTW cookies are the reliable way. Any specific requirement?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39577
    
  27
The way to do this are sessions, not cookies. And sessions work even in the absence of cookies (read up on URL rewriting, which is supported by the servlet specification).

And yes, using IP addresses has numerous problems that render this approach unusable in the general case.


Ping & DNS - updated with new look and Ping home screen widget
harshvardhan ojha
Ranch Hand

Joined: Jul 26, 2007
Posts: 157
    
    1

Ulf, how can we identify a user next time using URL rewriting? I don't think user will bookmark my URL or I can't keep my session active for so long.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39577
    
  27
Doesn't the user have to log in? At which point he'd be authenticated?

But ultimately, if the user doesn't accept cookies then hid experience of the modern web will be diminished. I think thats's a perfectly acceptable tradeoff.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Remember Me Functionality Implementation
 
Similar Threads
difference betwen tomcat and websphere
j_security_check /w "remember me"
How to do all this things?
Remember me auto login Liferay
wich session tracking techniwue to use