Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...going from mysite.com to www.mysite.com logs you outgoing from mysite.com to www.mysite.com logs you out
Previous
 
Next
New Post
7/22/2007 11:26 PM
 

How come if I log in under the address mysite.com and then click on a link that is addressed to http://www.mysite.com/Forums/tabid/57/Default.aspx it automatically logs me out. I've changed all my links to disclude the site name so that now they just say /Forums/tabid/57/Default.aspx. But why is it that once a user logs in under either mysite.com or www.mysite.com they cannot click on links pointing to the other without getting logged out?

The place where this becomes a problem is with browsing on an external site briefly such as CafePress.com. I have a menu bar on cafepress that points the user back to my dnn site and all the links on that menu bar have to be coded as either www.mysite.com or just mysite.com. So if I link them all with the www. then anyone who logged in under just mysite.com will automatically get logged out when they browse back to my dnn site. All the links on dnn are generated as either www.mysite.com or just mysite.com depending on how you first came to the site, which is all fine until you browse to a link different then what you started on. It doesn't matter if you're not logged in, you'll see the pages the same, it only really affects those logged in.

I tried making an HTTP Alias as just mysite.com and then another as www.mysite.com and then both existing together but that didn't have any effect.

I'm kind of stumped as to why this happens and how to get around it and what if anything am I doing wrong. Any and all help would be much appreciated. Thank you

 
New Post
7/23/2007 11:57 AM
 

This is by design.  The authentication cookie is mapped to the host of the domain because different host names could be totally different portals.  I suppose that www and blank could be considered the same and an exception be made in the code to check for that, but it really is better all around if you choose one and then have a low level 301 redirect to the other.

The following link has a way for you to do the 301 redirect and solve your logout problem at the same time:

http://www.snapsis.com/DotNetNuke/Support/tabid/560/forumid/12/postid/5428/view/topic/DNN-Tips-And-Tricks-5428.aspx

 


DotNetNuke Modules from Snapsis.com
 
New Post
6/13/2011 4:14 PM
 
Hi John,

I have this issue and am not seeing that link above go to the solution.

thanks in advance,

Will
 
New Post
6/13/2011 5:03 PM
 
Here is the code from that old post:

<script runat="server">

PrivateSub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Init
      If Not Request.Url.Host.ToLower().StartsWith("www") Then
        Response.Status = "301 Moved Permanently"
        Response.AddHeader("Location", Request.Url.Scheme & "://" & "www." & Request.Url.Host & Request.Url.PathAndQuery)
        Response.End
     End If
EndSub

< /script>

I recommend putting it in the skin for the home page so it only works on the specific portal.

If you put this in the default.aspx page, then this will only work if you are not using other host names as the Portal Alias for different portals.

If you are using other portals with different host names then you could also make the code above be more specific.


DotNetNuke Modules from Snapsis.com
 
New Post
6/13/2011 5:07 PM
 
I don't think you should be getting logged out when going from mysite.com to www.mysite.com anymore though. As I remember, that was changed in the DNN core code a long time ago so that no host and www are the same.

You may have an image or some other "hidden" request going to a different host name on the same domain.

DotNetNuke Modules from Snapsis.com
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...going from mysite.com to www.mysite.com logs you outgoing from mysite.com to www.mysite.com logs you out


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out