Page 1 of 1

Display Inaccessible file causes logged in users to logout

Posted: 21 Jun 2013, 18:47
by jtechmedical
We have some recent issues with downloads caused by protected downloads with Display Inaccessible file set to yes.

When the user clicks on the download while logged out they get the message "you need to log in" and are taken to the log in screen.
After logging in, when the user clicks on the download they are taken to a "log out" screen. :cry:

The only way our users can get the download is to log out, clear browser cache, refresh the page, and log in without clicking on the download. :x

We don't use joomla caching, and we are unsure why some users keep getting this log out screen rather than the download. Please help.

Re: Display Inaccessible file causes logged in users to logo

Posted: 26 Jun 2013, 00:32
by Jan
Hi, hmmm, really no idea what can be wrong there, testing now with Phoca Download 2 and get no such problem, I thought, this can be some cache setting, but if you have disabled it, really no idea what can be wrong - after login, if the system has information that user is logged it, the file is then accessible :idea:

Jan

Re: Display Inaccessible file causes logged in users to logo

Posted: 26 Jun 2013, 17:14
by jtechmedical
I've had three thoughts on this issue.
1) We do have some expires header rules set in our .htaccess file, which I believe controls some browser caching of files. Maybe there is a file which is cached by the browser which shouldn't be.

2) We use Akeeba Admin Tools to create the framework for our .htaccess file. We have found some components need direct access to a specific file or folder to insure the component works. Maybe there is something which is being restricted and needs an exception added to make it work.

3) Maybe something with our SEF component is misdirecting the downloads (I think this is less likely since Phocadownloads is set as an exception, and it works when the browser cache is cleared)

Re: Display Inaccessible file causes logged in users to logo

Posted: 27 Jun 2013, 19:12
by jtechmedical
I've some testing on my development site. I can confirm that I get the issue with the following steps:
  1. Without logging in
  • click on the download button for an inaccessible file which is displayed
  • this will display the log in screen and a notice that you need to be logged in
  • log in - which will return you to the download
  • click on the download, which will take you back to the log in screen and displays a log out button
with some additional testing I can confirm that the issue is related to expire headers in our .htaccess file. (removing the expire headers in the .htaccess fixes the issue)

The following lines in the .htaccess file were the cause
########## Begin - Optimal default expiration time
<IfModule mod_expires.c>
# Enable expiration control
ExpiresActive On

# Default expiration: 1 hour after request
ExpiresDefault "now plus 1 hour"

(The code below is excluded from this post since the maximum number of allowed characters in a post is 3000)
# CSS and JS expiration: 1 week after request

# Image files expiration: 1 month after request

# Audio files expiration: 1 month after request

# Movie files expiration: 1 month after request

# Add correct content-type for fonts

# Add a far future Expires header for fonts

</IfModule>
########## End - Optimal expiration time

I assume there is some file which is being cached by the browser thanks to the expire headers which is causing the problem.

From my testing it seems the "Default expiration: 1 hour after request" line is the root cause. Seems some file needs to be excluded from the expire header in the .htaccess file.

Re: Display Inaccessible file causes logged in users to logo

Posted: 02 Jul 2013, 23:15
by Jan
Hi, hmm, no experiences with such kind of problem with .htaccess :idea: Really cannot give any clue advice there :idea:

Jan