Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Google Chrome on iPad Saves Session ID After Close

Posted on 2015-01-15
5
Medium Priority
?
340 Views
Last Modified: 2015-01-22
My experience in the past has been that when you close a browser it deletes the sessionID in php.

But with Google Chrome on the iPad I am noticing that the sessionID is maintained and is not reset. It appears to be saving the sessionID as a cookie and reuses the sessionID even if you close the browser.

My application stores data in a database based on the session ID so this creates a problem for me.

Is there a workaround that would:

a) Keep the same sessionID within a browser session even if you go to a different site. If you come back to the site, the same ID would be used.

b) Keep the same sessionID if you open a second tab on the site.

c) Delete the sessionID if you close the browser.

Or am I missing something really big here with how sessions are supposed to work.

Thanks.
0
Comment
Question by:pkonstan1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 600 total points
ID: 40551949
The sessionID cookie should remain as long as Any window of the browser is open.  They only expire when ALL browser windows are closed and the program exits.
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 450 total points
ID: 40552009
If old session id is a problem then associate it on the database with a timestamp and if the client comes to the server with an old session then replace it with a new one. You have resource and cognitive control from the server side. You never let the control of a session in which there are possible DB updates to be controlled by the client.

Cd&
0
 

Accepted Solution

by:
pkonstan1 earned 0 total points
ID: 40552347
I agree with both of your comments and that has been my practice and experience for ten years. But i noticed today that the behavior on my iPad was different in that even if Google Chrome was totally closed on the iPad, the session ID was saved as a Cookie. So the next time I opened it up, it loaded that session from the cookie.  I did the following as an experiment to test.

1. Opened up my site and loaded a page or two.
2. Closed the browser completed.
3. Put two lines of code in a php page test.php page.  
print_r($_COOKIE); die ("at stop point");

Open in new window


If I follow these three steps on my desktop, I get an empty cookie.
When I do it on my iPad I get an array returned [0][PHPSESSIONID] jufieefjei7879ef89w7598739

It could be that my iPad also has some other Google things like a search and maps. So if they're based off the same environment maybe that's why the cookie is staying persistent... its as if the browser isn't "really" closed unless all of those other process (as well as maybe some background processes) are killed as well.

What do you think?
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40552463
Sounds very likely to me.  Google likes to keep thing running the 'background'.  Chrome on the desktop has an option that you can uncheck to stop allowing it to run things after the browser is closed.
0
 

Author Closing Comment

by:pkonstan1
ID: 40563901
Ultimately it was what I had originally suspected. The two contributors gave some insight that was helpful but it simply brought me back to my original thoughts.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question