[opencms-dev] Guests and sessions
Jonathan Woods
jonathan.woods at scintillance.com
Thu Jun 8 08:22:18 CEST 2006
It's easy to maintain sessions in an OpenCms 'application'. In sample
OpenCms code and in most people's use of it, JSPs are written with the page
directive attribute session=false, just to avoid the overheads associated
with session maintenance. But it's quite possible to write an
OpenCms-hosted JSP with session=true, and (as you'll know) you would have to
do this in order for sessions to be maintained. The session maintenance
mechanism would be the usual jsessionid stuff, and as usual you could stash
your application's session state in the JSP session scope by your usual
preferred means.
In other words, statefulness/statelessness is only associated with the Guest
user in that in the absence of a session, the user is always taken initially
to be the Guest user. Of course, your own code could then decide to 'log
in' the current CmsRequestContext as another user, but if sessions weren't
being maintained that would be a one-off thing.
On the subject of SEO, I asked Google about how it treated jsessionids,
because for such an important topic it didn't seem to be covered very well
anywhere. I've copied the exchange below (I'm sure Google won't mind). I
guess it doesn't tell you anything you don't already know, and it still
leaves me thinking that Google doesn't like statefully-browsed web sites...
I'd be interested to know what you end up doing.
Jon
======================================
Hi Jon,
Thank you for your note. [...] Please be advised that in order for Googlebot
to be able to crawl your site effectively, your server should not require
cookies for HTTP requests with a User-Agent header that includes the
substring "Googlebot" anywhere in the header value.
Additionally, as you may already know, session IDs can cause problems for
our robots. Please disable session IDs for Googlebot so that our robots may
crawl your site more efficiently.
We appreciate your taking the time to write to us.
Regards,
The Google Team
Original Message Follows:
------------------------
From: [me]
Subject: Does Googlebot honor per-session cookies when crawling?
Date: Sat, 21 Jan 2006 04:31:49 -0000
I'm writing a Tomcat-based web application for a CMS-driven web site.
Tomcat can maintain sessions using cookies or by rewriting URLs (to contain
a JSESSIONID parameter), and it will adopt its behaviour on the fly
depending on the capabilities of the user agent visiting it.
Does Googlebot honor (i.e. accept and re-present) cookies when crawling a
site? If so, that's great; if not, then Google search results for my site
will contain an ugly JSESSIONID parameter.
Thanks in advance, and keep up the good work.
Jon
_____
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Chris Stephens
Sent: 08 June 2006 06:35
To: opencms-dev at opencms.org
Subject: [opencms-dev] Guests and sessions
Hi folks,
I hope this question does not repeat earlier ones: I have looked and could
not find the same question on the list previously...
I understand that OpenCms treats every visitor not signed in as Guest. So
logging out in fact entails logging in as Guest.
I also notice that browsing an OpenCms website (e.g. the demo pages) as
Guest does not set any cookies.
This is great news for SEO: no need to artificially get rid of the
JSESSIONID (or similar) part of the URL!
But if the Guest activity is not stateful then does that mean I cannot set
session variables per Guest user? This is a major problem for us because we
need to track a Source ID (from a banner ad) through our site until the
visitor starts an application for one of our products. At that point and
thereafter the Source ID is dealt with by the form framework.
Is anyone doing something similar? Can anyone provide some suggestions?
Thanks,
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060608/a793677c/attachment.htm>
More information about the opencms-dev
mailing list