CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Being logged out when I use Find Contacts
Pages: [1]

Author Topic: Being logged out when I use Find Contacts  (Read 2058 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Being logged out when I use Find Contacts
June 09, 2009, 02:41:36 pm
Hi there.

I am seeing that after logging into my Drupal site as an admin user and using the Find Contacts feature of CiviCRM that I am over 50% of the time given a "Permission Denied" error, logged out, and forced to login again.  This second time the login usually sticks for a while and I am able to use CiviCRM normally.  Occasionally, this logout occurs a second time, usually several minutes after my second login, and I am forced to login a third time.

I notice, generally speaking that the logout problem doesn't seem to occur in CiviCRM except in the Find Contacts pages, but this could just be coincidental as I use Find Contacts more than anything.

This problem started ocurring about the time when I upgraded from 2.2.3 to 2.2.5 although I cannot be certain that is the cause.

We use a Top Notch drupal theme.  When I use a default theme such as Minelli the problem doesn't seem to occur.

Any idea what could be the source of this login problem?  No word from Top Notch yet.

Try CiviTeacher: the online video tutorial CiviCRM learning library.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Being logged out when I use Find Contacts
June 09, 2009, 02:57:10 pm
Is your URL changing between pages (e.g. http://www.mydomain.org and http://mydomain.org)? Check out the third item in lobo's recent "support desk" blog post:

http://civicrm.org/node/577
Protect your investment in CiviCRM by  becoming a Member!

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Being logged out when I use Find Contacts
June 09, 2009, 04:47:17 pm
Unfortunately I believe this www.example.com and example.com mentioned by Lobo at http://civicrm.org/node/577 may be bigger than people might think.  I spent a few hours debugging this issue today for my own and others' benefit.

First off, the code snippet Lobo provided doesn't work in .htaccess in the Drupal root directory if you have Drupal installed in a subdirectory (not at root level), and not everyone has direct access to their httpd.conf file

I am using this snippet at the .htaccess at www.irest.us/drupal ...I copied this into .htaccess
Code: [Select]
 RewriteCond %{HTTP_HOST} ^www\.irest\.us$ [NC]
  RewriteRule ^/(.*)$ http://irest\.us/$1 [R=301,L]
  RewriteCond %{HTTP_HOST} ^www\.irest\.us$ [NC]
  RewriteRule ^/(.*)$ https://irest\.us/$1 [R=301,L]
With no effect that I can see.

Second of all, I took some time to test $cookie_domain in settings.php and this appears to have no effect on the problem.  So this is not a solution from what I could tell..but maybe I missed someting.

Thirdly "www." links appear to be coded into certain aspects of CiviCRM Find Contacts based on the define( 'CIVICRM_UF_BASEURL' in civicrm.settings.php such as the "View" and "Edit" links on the search result pages whereas other links are not.  Also a security error is generated using the Dojo JS for the tabs which renders tabs inoperable if someone is logging in at example.com but then surfing Contact search results with www. in the links by CiviCRM.  

So part of the problem is that someone should not define their define( 'CIVICRM_UF_BASEURL' with a "www" in it and make sure consistently across the site that www is removed from all cookie domains, base URLs etc

I have uploaded screenshots.  All of these screenshots were after I logged in at irest.us note the lack of 'www' in the URL.  Then proceed to the Find Contacts area of the site for some rather odd behavior.  This was because the www was in the define( 'CIVICRM_UF_BASEURL' but I was logging in at irest.us/drupal without the rewrite

What can I do for a working rewrite rule?  Should something be written into the code to prevent this seemingly simple issue of "www or not to www" from causing logout problems and other issues for CiviCRM? Until then I will just remember to always login without the www


(http://www.irest.us/drupal/www1.png)
(http://www.irest.us/drupal/www2.png)
(http://www.irest.us/drupal/www3.png)

PS. Why such a strict limit on attachment size to forum posts?  What is it like 64K?  wow.
« Last Edit: June 09, 2009, 05:26:01 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Being logged out when I use Find Contacts
June 09, 2009, 07:48:48 pm

just a couple of clarifications:

1. CiviCRM is an open source project. We try to help to the best of our ability

2. This issue is at a level above civicrm (its an apache and cms issue). I blogged about it to help others who are in the same boat and who struggle wth it, and would like to avoid getting flamed in future :)

3. The first issue redirecting from www.example.com to example.com. This works for us on civicrm.org (go ahead, try it). We have no idea if it works/does not work in .htaccess. I did mention that we used this in httpd.conf. We are not apache experts and do not plan on testing all configurations

4. The cookie_domain setting is a drupal setting. We have not tried it out or tested it. You can search for help on the drupal issue queue. personally i prefer doing it via redirection.

5. If your site uses a mixture of www and no-www, then check:

http://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location

and ensure all references are to one or another

lobo



A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Being logged out when I use Find Contacts
June 10, 2009, 12:40:18 pm
Lobo, I'm afraid I don't understand.  Did you think I was flaming you?

I was trying my best to solve my own problem and help others with the similar problem that they might be having.  Your post helped me to determine what the problem was that I was having.  I tested the issue thoroughly, found a workaround and posted my results for the benefit of others.   Did you find the screenshots helpful or enlightening in any way?   If not I will remove them.  

So again, I don't fully understand your comments, but I appreciate your response.

« Last Edit: June 10, 2009, 12:42:27 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Being logged out when I use Find Contacts
June 10, 2009, 05:57:29 pm

i misunderstood your tone. apologies :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Being logged out when I use Find Contacts
June 10, 2009, 06:17:31 pm
No worries, apologies from me if I came across inappropriately.  I will do some research on how to get a rewrite rule working for my site and then post it here.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Being logged out when I use Find Contacts

This forum was archived on 2017-11-26.