note 51548 added to ref.session
| From: | wolfpack at osu1 dot php dot net | Date: | Sun, 03 Apr 2005 16:02:50 +0000 |
| Subject: | note 51548 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87404@lists.php.net to get a copy of this message | ||
Search engines in general don't support cookies, and they don't do well with SIDs in the
query string. If you use sessions, especially URL-based sessions, and want your site to be search
engine friendly, the following works well:
<?php
$br = get_browser();
if (!($br->crawler))
{
// any session-related code goes here
}
else
{
// whatever your page needs to work without sessions
}
?>
To use the function get_browser() you may need to install browscap.ini. See the documentation for
get_browser() for more info.
----
Manual Page -- http://www.php.net/manual/en/ref.session.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51548
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51548&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51548&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51548&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51548&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51548&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51548&report=yes
Search -- http://master.php.net/manage/user-notes.php