0

On websites like eBay, if you would time-out of your session, and say you were looking at a shoe, when you come back(after your sleep) to the page, you'd see the shoe, but you're logged out.

However, once you log back in, you get directed to that shoe immediately.

I am thinking that I say : "After timeout from website, upon re-login go back directly to page where timeout happened."

But how is this functionality described(as in, what technologies will we use)? Also, is it something that needs alot of resources?

Caffeinated
  • 11,982
  • 40
  • 122
  • 216

1 Answers1

1

Quite often it's done by having a "Return To" url passed along to the login page.

So.... (Logged in)

  • Visit Shoe Page
  • Session Times out
  • Either via js on timeout or next page refresh, user will see logged-out shoe page
  • Login link on that page includes the url of the shoe page eg Login.php?ReturnTo=ShoePage.php

Note that this applies to websites. You've also added a web service tag which is completely different - web services have no concept of a "current page"

If you decide to store the last page for the user in the db, what happens if the last page visited is no longer valid? You'd also be adding 1 Db operation per page load (to update the last visited page). No real performance concern but worth knowing. It's slightly non-standard behavior so you'd need to make sure the user knows why they've been redirected

Basic
  • 26,321
  • 24
  • 115
  • 201
  • Hi 'Basic, I was curios about the 3rd item in the list, "Either via js on timeout or next page refresh, user will see logged-out shoe page " = b/c on the website I want to fix, when it times out , you will still see the same page. but once you click anything then that's when you get sent to home login-page. – Caffeinated Jul 31 '12 at 04:21
  • 1
    It depends how you handle session timeouts. By default, the user won't know and it will work as you describe. It's not uncommon to start a JS timer on the page, set to expire when the session does (or a few minutes before so you can show a friendly notice). You could do the same and cause a page refresh when the session times out (or, optionally, make an AJAX call and renew the session). If you have pages that can only be accessed while logged in, they should do a 302 redirect to the login page including the return URL. – Basic Jul 31 '12 at 10:05