Wickham Posted February 3, 2009 Report Share Posted February 3, 2009 I've used Stefan's tutorial for session code and all browsers show date time or browser information if the code is on the first page, but if the session is repeated on a second page which he calls session.php, Opera and Google Chrome do not show the date and time or browser data but IE7, Safari and Firefox do work. <?php session_start(); ?> above the doctype on session.php and <?php echo " Wickham43.net PHP page was opened on " . $_SESSION['time'] . "";?> in the body Is this a known bug with these browsers and how is it overcome? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 3, 2009 Report Share Posted February 3, 2009 What is your code for both pages? Quote Link to comment Share on other sites More sharing options...
Wickham Posted February 3, 2009 Author Report Share Posted February 3, 2009 This test page shows the code in the main page and the code in the linked session2.php page below the horizontal rule. http://w ww.wickham43.com/forumposts/phpdatetime3.php The date time shows in all browsers on the same page but if you click the link to session.php you will see that Opera and Chrome do not show the date and time, so it looks like a browser problem rather than a php code problem. but it could be serious for Opera or Chrome users if their session isn't working so I wondered if there is a solution. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 3, 2009 Report Share Posted February 3, 2009 I don't know why it isn't working for you... I checked the pages, and they seem to work fine for me. I'm using WinXP and the latest versions of Opera and Chrome. Quote Link to comment Share on other sites More sharing options...
tpattison Posted February 3, 2009 Report Share Posted February 3, 2009 Do your Opera and Chrome have cookies enabled? Sessions are stored in cookies. Quote Link to comment Share on other sites More sharing options...
Wickham Posted February 3, 2009 Author Report Share Posted February 3, 2009 (edited) I thought that might be the answer, but it isn't. I usually have cookies set as session cookies only, but Opera has more detailed cookie settings and I've tried "Accept cookies only from the site I visit" and "Accept cookies" and checked in Manage Cookies and seen that my site is listed there, but the linked page session2.php still doesn't show the date and time. I've cleared the cache and history too. However, Chrome had cookies blocked (I don't use this browser much) and after unblocking cookies the date and time now show on the session2.php page, so I'll try Opera again. Edit: Opera still refuses to show the date and time on session2.php even with cookies. Edit2: at long last I've got Opera to work. I reset the global cookie setting and it didn't work, but then I found that I'd set my own domain names in the site specific settings to accept javascript but the cookies were still blocked, so that setting overrode the global setting to accept them. Thanks tpattison. Edited February 3, 2009 by Wickham Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.