3 Replies - 530 Views - Last Post: 05 February 2013 - 09:47 AM

#1 albert018  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 07-January 13

Does AJAX affect session timeout?

Posted 05 February 2013 - 04:53 AM

There is a online user counter in my website.

I refresh the page per five minutes because I hope the counter is always newest.

But I got a problem, the session will never timeout.

Even the users idle in one page without doing anything, they don't even get timeout.

So I am considering to use the mechanism of AJAX because it only need to refresh partial section in the page.

Does it work ,or is there any better solution to deal with it?

Is This A Good Question/Topic? 0
  • +

Replies To: Does AJAX affect session timeout?

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3524
  • View blog
  • Posts: 10,169
  • Joined: 08-June 10

Re: Does AJAX affect session timeout?

Posted 05 February 2013 - 06:05 AM

Quote

Does AJAX affect session timeout?

of course. AJAX does a HTTP Request, sending along all cookies (etc.). therefore the server can not (easily) tell (maybe with some extended Header analysis), whether the HTTP Request comes from Java​Script (AJAX) or the user (page (re)load) and hence the session is updated as well.
Was This Post Helpful? 1
  • +
  • -

#3 albert018  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 07-January 13

Re: Does AJAX affect session timeout?

Posted 05 February 2013 - 08:49 AM

View PostDormilich, on 05 February 2013 - 06:05 AM, said:

of course. AJAX does a HTTP Request, sen.........


Is there any suggestion to achieve this goal?

Or the user counter and session timeout could not exist together??
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3524
  • View blog
  • Posts: 10,169
  • Joined: 08-June 10

Re: Does AJAX affect session timeout?

Posted 05 February 2013 - 09:47 AM

there are several possibilities, though.

option one: you could try to remove the session id/cookie

option two: manually send a request that terminates the session
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1