Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Perlmonks 'Not logged in Error' - Proposal for fix

by tmharish (Friar)
on Jan 20, 2013 at 09:24 UTC ( [id://1014265]=monkdiscuss: print w/replies, xml ) Need Help??

Hi

Anyone who has used perlmonks for any length of time must have come across a scenario wherein ( when they are logged in ) they suddenly see a page of the website wherein they are not.

I am not talking about perlmonks using different sessions for the domains 'perlmonks.org', 'perlmonks.com' and 'perlmonks.net'

It turns out that perlmonks seems to use different sessions for www.perlmonks.org and perlmonks.org.

I can kind of see the reasoning for different sessions for .org, .com and .net ( although this might not be good from a search engine point of view and considering we at perlmonks want to promote the wisdom on the site, we might want to think about that.)

Although I can not be sure of this as I do not know how the code works, I believe it is possible that this might solve the 'you are not logged in' issue on some of the Other CB clients

IMHO I believe www.perlmonks.org and perlmonks.org ( and similarly for the .net and .com ) should use the same sessions. Since perlmonks uses apache this can be done by changing some settings on the virtual host or ( easier but more load on the server ) adding a .htaccess file.

Maybe one of the gods can give some insight into if this makes sense?

Update: This should have probably gone into perl monks discussion - My Bad!

Moved by tobyink - Thank you.

  • Comment on Perlmonks 'Not logged in Error' - Proposal for fix

Replies are listed 'Best First'.
Re: Perlmonks 'Not logged in Error' - Proposal for fix
by Corion (Patriarch) on Jan 20, 2013 at 10:04 UTC

    Perlmonks simply sets a cookie and whatever client you use remembers it for whatever hostname you use. There is no way to convince a browser by doing .htaccess magic or other server configuration so that the browser sends a cookie for www.perlmonks.org when it accesses perlmonks.org.

    We could make http://perlmonks.org always redirect to http://www.perlmonks.org, but I'm not really convinced that there actually is a problem.

      Not by server configuration, but by changing the code.
      You could explicitly set the cookie domain to .perlmonks.org for http://perlmonks.org and http://www.perlmonks.org

      99% of the problems could be fixed by autocorrecting perlmonks linking shortcuts in preview (and whatever processes chatterbox talk)

      The problem is folks typically use  [ http...perlmonks...node_id=... ] instead of  [id://...#] or rarely the  <a href="http...perlmonks..."> which results in unrelative links

      This could be easily fixed for new nodes

        99% of the problems could be fixed by autocorrecting perlmonks linking shortcuts
        I agree. I have done that in my forum software (with the possibility to turn it off), and it's really helpful
      We could make http://perlmonks.org always redirect to http://www.perlmonks.org

      Which is what I was hoping for!

      I'm not really convinced that there actually is a problem.

      I am not so sure about that - For those more experienced, it certainly is not a problem. But for someone new to programming it might be.

      Wouldn't it make more sense to let those who know what they are doing go through a little more effort to achieve a couple of things ( such as post from multiple users using different domains ) and so on rather than forcing those who are relatively new to make sure they use relative links?

Re: Perlmonks 'Not logged in Error' - Proposal for fix (link render)
by tye (Sage) on Jan 20, 2013 at 17:26 UTC

    How about having [http://(www\.)?perlmonks.(org|net|com)/(.+)] be rendered the same as [href:///$2] ? The next step would then be to filter <a href=...> similarly (such are already fully parsed and so can be reliably filtered).

    I tend to prefer to fix the rendering over changing the text that users have entered. It automatically fixes old nodes and getting it wrong in some way doesn't leave garbage saved that then has to be found and cleaned up.

    Though I also see value in having perlmonks.org redirect to www.perlmonks.org but I suspect that will annoy a few people. I'd rather go in that direction than from www.perlmonks.org to perlmonks.org as it leaves open the unlikely possibility of wanting DNS entries for perlmonks.org to be less specific than "for web traffic", despite the trend for dismissing any such future possibilities.

    If such a redirection is implemented, then the destination page probably also needs to re-issue a cookie, which complicates things. Though maybe not. It seems that cookies for perlmonks.org will work for www.perlmonks.org (that isn't always the case in the other direction, which could be another reason for standardizing on www.perlmonks.org as google already does -- because I told them to).

    - tye        

      > How about having [http://(www\.)?perlmonks.(org|net|com)/(.+)] be rendered the same as [href:///$2] ? The next step would then be to filter <a href=...> similarly (such are already fully parsed and so can be reliably filtered).

      Practically the server side equivalent of my nodelet hack? If it's easily feasible it's IMHO the best over all idea.

      You may want to consider an exception rule (like #no_redirect at the end of the URL) to allow people to hard-link domains w/o conversion.

      Cheers Rolf

        Practically the server side equivalent of my nodelet hack?

        IMHO the difference is that in the nodelet hack the load is distributed amongst the clients whereas otherwise its taken up by the server. ( A good thing )

        But considering that this entire thing might be something that newbies will find useful, it might make sense to have it as part of some default JS loaded.

        A server side redirect though, will cause less load and will solve this even for those accessing the site through some automated means. ( other than through a browser )

        You may want to consider an exception rule (like #no_redire­ct at the end of the URL)

        That's actually why I didn't include (:80)? in the proposed regex.

        - tye        

      If such a redirection is implemented, then the destination page probably also needs to re-issue a cookie

      If we did this server side then anyone landing on perlmonks.org would get redirected to www.perlmonks.org and no one would ever login on perlmonks.org. We could make this a 301 permanent redirect.

      I tend to prefer to fix the rendering over changing the text that users have entered. It automatically fixes old nodes and getting it wrong in some way doesn't leave garbage saved that then has to be found and cleaned up.

      The only problem with this could be the additional load on the server. For each page rendered the code will have to additionally check :

      $node_contents =~ s/(http:\/\/)?(www\.)?(perlmonks\.)(org|net|com)\/(. +*)/$1www.perlmonks.$4\/$5/g;
        anyone landing on perlmonks.org would get redirected to www.perlmonks.org and no one would ever login on perlmonks.org.

        I realize that. Do you realize that there are already people with existing cookies from perlmonks.org?

        The only problem with this could be the additional load on the server.

        The device has yet to be invented that could notice that miniscule of a difference in server load.

        - tye        

Re: Perlmonks 'Not logged in Error' - Proposal for fix
by LanX (Saint) on Jan 20, 2013 at 12:00 UTC
    I had the issue to be logged into perlmonks.org but google site-searches only showed www.perlmonks.org.

    I also logged into www.perlmonks.org and after correcting most of my bookmarks I had no more problems. So I recommend chosing www.perlmonks.org as your primary server.

    If you are still experiencing any problems, I'm sure it's possible to configure an automatic redirection in your browser, at least with JS.

    For instance see https://addons.mozilla.org/en-us/firefox/addon/redirector/

    If you log into any new server popping up, you can also use a free nodelet hack for redirection.. ... I can show you how if you're interested!

    I certainly doubt that the gods will ever do a redirection on server side, to many people have used this behavior already.

    Cheers Rolf

      Thanks for solutions LanX and I would love it if you could help with the 'free nodelet hack for redirection'.

      On the other hand I somehow believe that since PerlMonks is a primary resource for Perl programmers ( both experienced and novice ) the default behavior of the site should be user friendly.

      Most of those experienced with perlmonks would realize they are not logged-in when the page turns blue ( from the logged-in red ). Whats more, those wanting to use two logins can just as easily use multiple browser sessions to achieve this.

      Don't you think that default behavior should help newcomers as opposed to those who are experienced and can find ways to achieve what they want to anyway?

Re: Perlmonks 'Not logged in Error' - Proposal for fix
by Anonymous Monk on Jan 20, 2013 at 10:08 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://1014265]
Approved by tobyink
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-04-19 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found