0

My website has a page (named "Private") where a user can login with his username and password. The problem is that when a user is logged in and the page is refreshed (or the user switches to another page and then goes back to the "Private" page), the session seems to have expired and the user needs to login again. I'd like to make it so the session doesn't expire for 30 minutes. How would I do that?

jeremy
  • 9,965
  • 4
  • 39
  • 59
rocketer
  • 1,051
  • 3
  • 13
  • 40
  • Are you making sure to call `session_start();` on other pages as well? – jeremy Jul 06 '14 at 18:37
  • Have you tried to search? Look at this complete answer: http://stackoverflow.com/a/8311400/835146 – ocirocir Jul 06 '14 at 18:37
  • It's not a duplication, but i'm going to check this similar topic, thanks. Yes I do call session_start() on every other pages – rocketer Jul 06 '14 at 18:42

1 Answers1

0

All about what you want: session_set_cookie_params

session_set_cookie_params('3600'); // 1 hour
session_start();
web_student
  • 186
  • 3
  • 16