0

I would like to know how I could do to keep the session open on my site even by closing and reopening the browser. Right now I'm studying everything that has to do with Java Servlets, JSPs, etc ...and I should create a project that aims to create an e-commerce site.I will explain myself better with regards to "keeping the session open on my site also by closing and reopening the browser": I would like to do what Amazon does more or less. Upon registration except for username, password, name, surname ... taken from the form in the database and at the time of login I take this data and i access the site. The problem is that if I close the browser I should log in again and I don't want this.As I understand it, I also need to implement a session to implement the cart where I should save the products I want to buy.So, in summary, how can I make a connection that lasts as long as I want until I press the Logout button?

This is for a university project that consists of the creation of an e-commerce site.

Manu
  • 11
  • `Stay Logged In` is something that you have to implement from scratch. For example, take a look at this https://stackoverflow.com/questions/5082846/how-to-implement-stay-logged-in-when-user-login-in-to-the-web-application – diogenesgg Apr 13 '19 at 20:10

1 Answers1

0

Have you tried using cookies? Maybe you can create a code that reads if there is a cookie with the user data, if it exists you can create a new session with that data.

Martn__
  • 23
  • 7
  • Could you help me with this thing? I'm not good with cookies ... But at least I know how to take the parameters from the request or do things like this :') – Manu Apr 13 '19 at 20:18