Author Topic: Found a problem  (Read 6639 times)

adoi

  • Confirmed Member
  • **
  • Posts: 6
  • Karma: +0/-0
Found a problem
« on: November 14, 2010, 10:25:56 PM »
I am testing my Etano site.

When i login as a user. I found navigation between the pages is normal.

But when the user clicks the site logo or the site name.
It navigates to the site index page

that is normal but it also "logouts the user form the site"

This error is also not same always. Sometimes, user is logout. while moving to the blogs, search page and who is online page (mostly on who is online, sometimes on blog).

How to solve this error.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2988
  • Karma: +210/-7
    • Maverick Webworks
Re: Found a problem
« Reply #1 on: November 15, 2010, 11:38:02 AM »
One possible reason for this type of behavior can be caused when manually creating URL's (such as when you create a custom header logo or name). When creating manual URL's make sure you are not using a non-www URL address for your site if in the "includes/defines.inc.php" file you have added the www prefix to the URL address.

In the includes/defines.inc.php file look for this line ...

define('_BASEURL_','http://www.mydomain.com');// protocol required (http:// )

If the www is what you defined as your domain when installing the script, you need to include this prefix whenever you manually create links. If you defined your site as www.mysite.com then that's what needs to be used when browsing all pages of the site or else the user's session will get dropped thus logging them out. Of course if you didn't define the www prefix then you need to also not include it when you manually create URL links.

In other words, www.mydomain.com won't be recognized as being the same domain as just mydomain.com, thus can cause the session to get dropped if the domains happen to get switched between pages.

Open your index.html and frame.html files and check your URL links for your site name and logo box and make sure they are consistent and are the same as defined as your BASEURL in the defines.inc.php file.

You can also often prevent such conflicts by including the following in the top portion of your .htaccess file in the main root folder ...

#Always add www to URLs
RewriteBase /
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^(.*)$ http://www.mydomain.com$1 [R=301,L]


I'm not sure if this is your problem or not, but by your symptoms it's the first logical thing to look into.

 

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

adoi

  • Confirmed Member
  • **
  • Posts: 6
  • Karma: +0/-0
Re: Found a problem
« Reply #2 on: November 15, 2010, 05:13:29 PM »
Right, problem was with www

When I run with htttp://www.mydomain.com there was no problem.'

But when I tried with http://mydomain.com problem again occured.

Editing .htaccess seems not solving the problem. I added the code you provided on the top.

I tried with editing php files. I do not get any link in index.php and frame.php. I found link in define.inc.php it was without www.

Users always been unpredictable while working on website. There is no way to make them type www always with the site name. Even I am working on this forum without www added to the link.

Please tell any other solution to the problem.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2988
  • Karma: +210/-7
    • Maverick Webworks
Re: Found a problem
« Reply #3 on: November 15, 2010, 06:50:48 PM »
Instead try this code at the top of your .htacess file ...

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]

This will automatically add the www prefix no matter if the user includes it when they type in the URL


In the includes/defines.inc.php file I'd also recommend adding the www prefix to your link.

define('_BASEURL_','http://www.mydomain.com');// protocol required (http:// )


Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

adoi

  • Confirmed Member
  • **
  • Posts: 6
  • Karma: +0/-0
Re: Found a problem
« Reply #4 on: November 16, 2010, 04:29:56 AM »
sorry, but problem still not solved.

First I edited only the name of site in .htaccess file. But it started redirecting me to main page.
Then the link comes with www

Realizing that i installed it in a folder. I added folder in the .htaccess file.

the logo and the site name. When ever it is clicked. User is logout of the site. I had edited the file in includes folder (Added www to base url).
 
I edited .htacess file as

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^mydomain\.org/dating/$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.org/dating/$1 [R=301,L]
DirectoryIndex index.html index.php
Options -Indexes

Current condition.

When user enter without www in site name and enter its details. It is not log in to site. and page comes with a link containing www
Also specifically user is logout on clicking blog whether using www or not using.

I had seen your demo. it is in a folder and the logo and site name on clicking showing no problem.

Is there any mistake I am doing here or I may try with a fresh installation again.


Hello, I installed etano again now with with site name with www in installation. but still problem is occurring user gets log out while surfing  between pages.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2988
  • Karma: +210/-7
    • Maverick Webworks
Re: Found a problem
« Reply #5 on: November 16, 2010, 10:58:14 AM »
Quote
I had seen your demo. it is in a folder and the logo and site name on clicking showing no problem.
The Etano demo site appears to be in a sub-folder named "friendy" but I don't know anything about it's setup as I'm not the developer or host of the Etano script. However, I do have my own Etano demo site and I didn't do anything special when installing Etano in a sub-directory folder. It just worked fine after installing the script, all I did was include the www prefix for the baseurl during the install process, I didn't bother adding any URL Rewrites to the .htaccess file since it's only accessed via a demo link on my site. On my demo site if you login normally (via the link) and then after being logged in if you remove the www prefix in your browser URL and hit "Go" you won't be shown as being logged in anymore, but you can login again without the www prefix and you will then be logged in and the site will work fine and all pages will work and continue on without the www prefix.

Quote
When user enter without www in site name and enter its details. It is not log in to site. and page comes with a link containing www
If you have the mod Rewrites added to your .htaccess and you type in the domain without the www prefix it should automatically add the www prefix. When the URL Rewrites are added you shouldn't get any page displaying without the www, not even the main index page. If you type in the domain without www prefix and it shows in the browser as being without www prefix then your Rewrites aren't working in your .htaccess file, and possibly the mod_rewrite isn't enabled or not allowed in an .htaccess context on your server, some virtual hosts don't allow access to certain things on their servers.

I do have one Etano based site that uses the URL Rewrites in the .htaccess file so all pages are auto converted with the www prefix and it's worked fine for more than 3 years now.

If you make any edits or add URL links, such as to the header logo or menu items in the index.html and frame.html files (which are located in the /skins_site/def/ folder), make sure the www prefix is used (if it's defined that way in your includes/defines.inc.php file), or better yet use the system default for your links by using the {tplvars.relative_url} like this ...  <a href="{tplvars.relative_url}index.php">{tplvars.sitename}</a> as this uses the baseurl defined in the defines file.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

adoi

  • Confirmed Member
  • **
  • Posts: 6
  • Karma: +0/-0
Re: Found a problem
« Reply #6 on: November 16, 2010, 11:15:33 AM »
You can check my site

removed

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2988
  • Karma: +210/-7
    • Maverick Webworks
Re: Found a problem
« Reply #7 on: November 16, 2010, 11:52:16 AM »
What appears to be happening is the system isn't properly recognizing this user, when you click the "Who's Online" link it should show any user that's online, including yourself when logged in, but it's not showing this user as being online so it instead logs the user out when viewing any search results. This user doesn't even show up when doing a basic search, which again will log you out.

I regenerated your skin to see if would make any difference, it now shows you as online but still logs you out, but it still can't find this user when doing a basic search. I also noticed when this user gets logged off like this, the admin also gets logged out of the admin panel as well, which shouldn't happen, at least it doesn't on any of my sites.

I've never experienced anything like this before, one other user had this issue a little while back but I don't know if they ever resolved it as they never posted back. All I can think of is there's an issue with your server configuration that's causing some kind of timeout.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

adoi

  • Confirmed Member
  • **
  • Posts: 6
  • Karma: +0/-0
Re: Found a problem
« Reply #8 on: November 17, 2010, 03:57:56 AM »
Any suggestion for server configuration.

During installation I got yellow color
PHP Server API
check PHP is configured as a CGI plug-in rather than an Apache module

Currently i am on shared host.

you can me tell the needed configuration to make it work properly.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2988
  • Karma: +210/-7
    • Maverick Webworks
Re: Found a problem
« Reply #9 on: November 17, 2010, 05:20:08 AM »
AWWW ok, this explains a lot as to why things aren't functioning properly. For one, when running PHP as a CGI module many custom directives are not supported in .htaccess, which is likely why the .htaccess directives I posted never helped you. Also CGI mode can cause issues with passing the session ID under certain situations which is probably one reason as to why the users are getting logged out.

I'm not sure that Etano is compatible with PHP running in CGI mode, and this is why you got the warning about it during the install, there's a lot of scripts that aren't fully compatible with the PHP CGI module. They will often install and run but you'll likely have some problems. I can't say for sure, but it may be possible to configure things so Etano will function properly with the PHP CGI module but I can't offer much help because I've never used the PHP CGI module, I've had my own dedicated server for many years and have always used the PHP Apache mode.

You can maybe check with your host, many hosts install both the Apache and CGI modules but CGI is the default, maybe they can switch it for you.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: Found a problem
« Reply #10 on: May 21, 2011, 09:23:40 PM »
I'm having this problem as well and didn't see this thread until after I posted my question on the issue. Was adoi able to find a solution?
I contacted my hosting service (certified hosting solutions) today and they're also looking into this to see if its something on their end.

The only difference for me is that I didn't have an installation error.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: Found a problem
« Reply #11 on: May 21, 2011, 10:56:46 PM »
So, I too have this problem. When I login, browse for all users and I don't even show up as if I'm not even there. I tried all of the suggestions in this thread and my problem is still there. So, for now I will wait until I hear something from my hosting service to see if the problem is on their end.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2988
  • Karma: +210/-7
    • Maverick Webworks
Re: Found a problem
« Reply #12 on: May 22, 2011, 01:47:28 AM »
The cause for this is often due to how domain gets resolved, www.mydomain.com and mydomain.com can react as different domains.

For example, in the includes/defines.inc.php file if the www prefix is added to your link (recommended)

define('_BASEURL_','http://www.mydomain.com');// protocol required (http:// )

Then you visit your site using just mydomain.com without the www prefix and login, mydomain.com is what will get added to your cookie session, and then when you click a link such as home or some other link that requires authentication it will switch to www.mydomain.com thus logging you out requiring a new session that includes the www prefix in the domain.

Basically what's happening is your session isn't being tracked as you navigate the site, which sometimes can especially be an issue if your server is running PHP as a CGI module.

To avoid this from happening your site needs to always resolve with the www prefix. When you go to your site by just typing in mydomian.com it should automatically switch to www.mydomain.com in the browser URL field.

To make your site always resolve with the www prefix you need to add the following directives in your .htaccess file ...

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*) http://www.domain.com/$1 [R=301,L]

Depending on your server's configuration you may have to use the following directives instead ....

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]

Of course this will only work if your host allows mod-rewrites, some hosts even don't allow custom directives to be added to .htaccess files.

If your Etano site is in a subfolder of the www root directory on your server, the above directives should be added to the .htaccess file included in the top level www root directory rather than in the .htaccess file included in your Etano directory. However, if your Etano site is directly located the main www root directory, then add the directives to the .htaccess file located there.

Again, if you type in just mysite.com in your browser's URL field and it automatically switches to www.mydomain.com then it working properly. Also make sure you have the www prefix added in your includes/defines.php file as mentioned above.

If you continue to have issues with being logged out you'll need to contact your host and tell them there's an issue with sessions being tracked, which can often be the case if they're running PHP as a CGI module.

If your host is using CGI module for PHP you can try removing the following directives in the .htaccess file located in the Etano root directory and see if that helps resolve the issue.

php_flag session.use_cookies on
php_flag register_globals off
php_flag session.use_trans_sid off

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: Found a problem
« Reply #13 on: May 22, 2011, 03:23:30 PM »
Thanks maverick. those last 3 items you listed are not in my .htaccess file. The support staff at my hosting service are looking into this problem. I showed them this thread as well. So, it's all in their hands at the moment. I will wait and see what they come up with. I'll let you know what solution they come up with.

I tried modifying the BASEURL to www because that wasn't present and I still had the problem. So, I switched it back.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: Found a problem
« Reply #14 on: May 23, 2011, 10:29:25 AM »
My hosting service did something to fix the problem. They originally said that altering the .htaccess file wouldn't solve the problem. But after a handful of their techs looked into this, they finally fixed it today. So, no more timeout problems. I asked how they resolved it, but they didn't say what they did. Now I have a user search problem, but I'll look around for the answer.

A moment ago (now Tuesday), I decided to see if my hosting service made a change to the .htaccess file and this is how it looks.
Before, the upper portion of the contents in the file were written as:

-------------

DirectoryIndex index.html index.php
Options -Indexes

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]


After my hosting service fixed the problem, my .htaccess file now says this at the top portion:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.omitteddomainnameforprivacy.com [NC]
RewriteRule ^(.*)$ http://omitteddomainnameforprivacy.com/$1 [L,R=301]

-------------
Note: the portion that says omitteddomainnameforprivacy is where my actual domain name is written in.
The "before" text that says "mydomain" is how the actual text was written.
I still don't know what else they might have done or if this was the only thing they changed.

They didn't touch the includes/defines.inc.php file. So the BASEURL does not have a www preceding my website URL and the website works perfectly.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.