close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Caching issues with authentication.php

Thread began 7/13/2018 9:35 am by Michel | Last modified 7/18/2018 11:26 am by Ray Borduin | 84 views | 5 replies |

Michel

Caching issues with authentication.php

Hi,

Maybe it’s the way it should work but I ask it anyway.
I have issues with browser cache. My browser, Google Chrome, is caching html files when I have required authentication.php (version 2.3) on the page. Very annoying on a development site.
I disabled browser cache in Chrome -> Development Tools -> Network Tap, by htaccess and in the header by php. But it is still caching. If I remove authentication.php from required files, the cache issues stops.
Is this normal?
Tnx,

Michel

Sign in to reply to this post

Ray BorduinWebAssist

I can't imagine why that would happen. It doesn't seem like it would be related. I don't see how the .php page would effect caching of your html pages.

Sign in to reply to this post

Michel

Hello Ray,

Thank you for your reply.
As I understand, authentication.php should not affect site caching.
I tried another browser and I experience no caching issues, so it had to be a Google Chrome thing.

Strange enough, after a few hours the problem also disappeared in Google Chrome.

I tried to reproduce the error but now everything works like it should.

Sorry, and thank you for your time.

Sign in to reply to this post

Michel

Originally Said By: Ray Borduin
  I can't imagine why that would happen. It doesn't seem like it would be related. I don't see how the .php page would effect caching of your html pages.  


Hello Ray,

I figured out what was wrong.
On my page, in the header I call several files;

require_once('Connections/kid20_i.php');
header('Cache-Control: no cache'); //no cache
//ini_set('display_errors',1);
session_cache_limiter('private_no_expire');
require_once('webassist/mysqli/queryobj.php');
require_once('webassist/mysqli/rsobj.php');
require_once('language/language.php');

If I place authentication.php below these require_once files, like;

require_once('Connections/kid20_i.php');
header('Cache-Control: no cache'); //no cache
//ini_set('display_errors',1);
session_cache_limiter('private_no_expire');
require_once('webassist/mysqli/queryobj.php');
require_once('webassist/mysqli/rsobj.php');
require_once('language/language.php');
require_once('webassist/mysqli/authentication.php');
if (isset($_POST["logoutbtn"]) || isset($_POST["logoutbtn_x"])) {
$LogOut = new WA_MySQLi_Auth();
$LogOut->Action = "logout";
$LogOut->Name = "user";
$LogOut->execute();
}
if ("" == "") {
$RestrictAccess = new WA_MySQLi_Auth();
$RestrictAccess->Action = "restrict";
$RestrictAccess->Name = "user";
$RestricAccessRedirect = "login.php";
if (function_exists("rel2abs")) $RestricAccessRedirect = $RestricAccessRedirect?rel2abs($RestricAccessRedirect,dirname(__FILE__)):"";
$RestrictAccess->FailRedirect = $RestricAccessRedirect;
$RestrictAccess->execute();
}

I have this issues with sessions, etc.
Now I call authentication.php at the top of the page and the problem is gone. Like;

require_once('webassist/mysqli/authentication.php');
if (isset($_POST["logoutbtn"]) || isset($_POST["logoutbtn_x"])) {
$LogOut = new WA_MySQLi_Auth();
$LogOut->Action = "logout";
$LogOut->Name = "user";
$LogOut->execute();
}
if ("" == "") {
$RestrictAccess = new WA_MySQLi_Auth();
$RestrictAccess->Action = "restrict";
$RestrictAccess->Name = "user";
$RestricAccessRedirect = "login.php";
if (function_exists("rel2abs")) $RestricAccessRedirect = $RestricAccessRedirect?rel2abs($RestricAccessRedirect,dirname(__FILE__)):"";
$RestrictAccess->FailRedirect = $RestricAccessRedirect;
$RestrictAccess->execute();
}
require_once('Connections/kid20_i.php');
header('Cache-Control: no cache'); //no cache
//ini_set('display_errors',1);
session_cache_limiter('private_no_expire');
require_once('webassist/mysqli/queryobj.php');
require_once('webassist/mysqli/rsobj.php');
require_once('language/language.php');

Not sure if this is unusual but it works.

Thank you.

Cheers,

Michel

Sign in to reply to this post

Ray BorduinWebAssist

You should start the session before writing headers to the page, so maybe that caused issues. I'm glad you got it sorted.

Sign in to reply to this post

Michel

Hi Ray,

Thank you for your reply.

I start the session in the db connection file.
But connection file is not included but required.

So the session_start() is required en not included.

maybe thats the issue.

Tnx.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...