Announcement

Collapse
No announcement yet.

Always logged out when not using www prefix

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Andy
    replied
    Originally posted by pitrow View Post
    admincp > settings > options > cookies and http header settings.

    under "cookie domian" make sure it's set to ".yourdomain.com" (notice the DOT in front of your domain name, it's VERY important).

    That will set the cookie to be valid for all sub-domains (i.e. www.yourdomain.com, yourdomian.com, xyz.yourdomain.com, anything.yourdomain.com, etc.) and will solve your problem without having to muck around with your .htaccess file.
    Using the .htaccess option is a better option IMHO because you will have consistent url links both internal and external. It's better for search engine optimization.

    Leave a comment:


  • Malluparadise
    replied
    open .htaccess and add this code on the end

    #RewriteEngine on
    #rewritecond %{http_host} ^mysite.com [nc]
    #rewriterule ^(.*)$ http://www.mysite.com/$1 [r=301,nc]

    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST}//s%{HTTPS} ^www.(.*)//((s)on|s.*)$ [NC]
    RewriteRule ^ http%3://%1%{REQUEST_URI} [L,R=302]
    Last edited by Malluparadise; Mon 17 May '10, 10:47am.

    Leave a comment:


  • pitrow
    replied
    admincp > settings > options > cookies and http header settings.

    under "cookie domian" make sure it's set to ".yourdomain.com" (notice the DOT in front of your domain name, it's VERY important).

    That will set the cookie to be valid for all sub-domains (i.e. www.yourdomain.com, yourdomian.com, xyz.yourdomain.com, anything.yourdomain.com, etc.) and will solve your problem without having to muck around with your .htaccess file.

    Leave a comment:


  • Andy
    replied
    Originally posted by JackieChun View Post
    Great, will try! Do I need FTP or can I do this from admincp?
    You will need to ftp the .htaccess file to your server. If it doesn't work, ask your web hosting provider for help.

    Leave a comment:


  • JackieChun
    replied
    Great, will try! Do I need FTP or can I do this from admincp?

    Leave a comment:


  • Andy
    replied
    Add this to your .htaccess file

    Code:
    RewriteEngine on
    rewritecond %{http_host} ^mysite.com [nc]
    rewriterule ^(.*)$ http://www.mysite.com/$1 [r=301,nc]

    Leave a comment:


  • JackieChun
    started a topic [Forum] Always logged out when not using www prefix

    Always logged out when not using www prefix

    The topic pretty much summarizes the issue.

    When I use www.mysite.com/forums, it prompts for a login once and keeps me logged in forever. As soon as I drop the www in the URL, it appears as if I am logged out, and logging in over and over doesn't change anything.

Related Topics

Collapse

Working...
X