Closed (duplicate)
Project:
Boost
Version:
6.x-1.18
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jan 2008 at 07:51 UTC
Updated:
3 May 2010 at 05:53 UTC
Occassionally am finding users have to log in twice, am using LAMP (PHP version 4, Apache 2). Here are the steps to reproduce:
I checked, the DRUPAL_UID and SESS[...] are present after the first login attempt, and it's not the cached version of the page which is served subsequent to the first log in attempt.
Comments
Comment #1
liam mcdermott commentedOne more thing: a 'Session opened for ..user..' log entry is created for the failed login attempt.
Comment #2
fozilla commentedI have the same issues, with the log entry and everything. Will turning off cached pages temporarily resolve this? I would like to keep the cached pages on because some of my users are in rural areas. Most of the users aren't tech savvy and logging in again or refreshing the page probably won't occur to them.
Comment #3
Gurpartap Singh commentedeh? :)
Comment #4
liam mcdermott commentedfozilla: The workaround I used was to switch off the login block and put a 'login' link in the main menu of my site, pointing people to /user People seem alright with this. :)
Comment #5
firebus commentedi wonder if the browser is serving the cached version of the home page after logging in with the block?
try a ctrl-f5 (force refresh) after the first login and see if you are magically logged in now.
i've found some other issues with the browser serving cached pages after login/logout when it shouldn't - it's only noticeable if you've got content on the page that changes for logged in vs. anon uses (like the login block)
Comment #6
samsouk commentedyou need an initial anonymous session to log-in, the /user page gives you one
Comment #7
mikeytown2 commentedSounds like it could be an issue with your htaccess file. Would you mind posting it?
The top part of the file is supposed to prevent your browser from caching the page
The other part that might be an issue is the Rewrite Conditions. The start of every Rewrite Rule block should have this at the top. It makes sure apache only serves the page when the http request is a GET. Login info is sent via POST, so if this isn't there it is an issue.
Comment #8
mikeytown2 commentedHas anyone encountered this with 6.x?
Comment #9
djudd commentedI am experiencing this with 6.x. Here is my .htaccess file.
I can log in, browse for a few minutes, and I'll be logged back out. Full refresh doesn't change anything.
Comment #10
mikeytown2 commented@djudd
What your describing is something different. I recommend opening a new issue explaining the bug in detail and how to reproduce it.
Comment #11
mikeytown2 commentedClosing all 5.x issues; will only reevaluate if someone steps up #454652: Looking for a co-maintainer - 5.x
Reason is 6.x has 10x as many users as 5.x; also last 5.x dev was over a year ago. The 5.x issue queue needs to go.
Comment #12
matt2000 commentedI'm having the same issue in 6.1.18. The very first page load (only) after log-in from the log-in block form is served from boost. I've verified the DRUPAL_UID cookie is present. Here's my .htaccess:
# Protect files and directories from prying eyes.
Order allow,deny
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php
# Force simple error message for requests for non-existent favicon.ico.
# There is no end quote below, for compatibility with Apache 1.3.
ErrorDocument 404 "The requested file favicon.ico was not found.
#"
# Set the default handler.
DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
# PHP 4, Apache 1.
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
# PHP 4, Apache 2.
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
# PHP 5, Apache 1 and 2.
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
# Requires mod_expires to be enabled.
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not allow PHP scripts to be cached unless they explicitly send cache
# headers themselves. Otherwise all scripts would have to overwrite the
# headers set by mod_expires if they want another caching behavior. This may
# fail if an error occurs early in the bootstrap process, and it may cause
# problems if a non-Drupal PHP file is installed in a subdirectory.
ExpiresActive Off
# Various rewrite rules.
RewriteEngine on
# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# adapt and uncomment the following:
RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment and adapt the following:
#RewriteCond %{HTTP_HOST} ^www\.mysite\.com$ [NC]
#RewriteRule ^(.*)$ https://www.mysite.com/$1 [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /
#phpbay rules
RewriteRule ^images/e/(.*)$ http://thumbs.ebaystatic.com/pict/$1 [R,L]
RewriteRule ^item-(.*)_(.*)_(.*)_(.*).html$ sites/all/lib/phpbay/auction.php?title=$1&item=$2&country=$3&ccid=$4
RewriteRule ^item-(.*)_(.*)_(.*).html$ sites/all/lib/phpbay/auction.php?title=$1&item=$2&country=$3
RewriteRule ^item-(.*)_(.*).html$ sites/all/lib/phpbay/auction.php?title=$1&item=$2
### BOOST START ###
AddDefaultCharset utf-8
Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
AddCharset utf-8 .html
AddCharset utf-8 .css
AddCharset utf-8 .js
AddEncoding gzip .gz
ForceType text/html
ForceType text/javascript
ForceType text/css
# Gzip Cookie Test
RewriteRule boost-gzip-cookie-test\.html cache/perm/boost-gzip-cookie-test\.html\.gz [L,T=text/html]
# GZIP - Cached css & js files
RewriteCond %{HTTP_COOKIE} !(boost-gzip)
RewriteCond %{HTTP:Accept-encoding} !gzip
RewriteRule .* - [S=2]
RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css\.gz -s
RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css\.gz [L,QSA,T=text/css]
RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js\.gz -s
RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js\.gz [L,QSA,T=text/javascript]
# NORMAL - Cached css & js files
RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css -s
RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css [L,QSA,T=text/css]
RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js -s
RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js [L,QSA,T=text/javascript]
# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^GET$ [OR]
RewriteCond %{REQUEST_URI} (^(admin|cache|misc|modules|sites|system|openid|themes|node/add))|(/(comment/reply|edit|user|user/(login|password|register))$) [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
RewriteCond %{HTTPS} on
RewriteRule .* - [S=3]
# GZIP
RewriteCond %{HTTP_COOKIE} !(boost-gzip)
RewriteCond %{HTTP:Accept-encoding} !gzip
RewriteRule .* - [S=1]
RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz -s
RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz [L,T=text/html]
# NORMAL
RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
### BOOST END ###
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Comment #13
mikeytown2 commentedSee this for solutions to your problem
#770774: after logout some pages are show as logged in?