View Full Version : Turn off session hash
NeverBored
01-31-2010, 03:02 AM
Is it possible to turn off the session hash in urls? Ideally of course in a plugin...
Marco van Herwaarden
01-31-2010, 08:56 AM
Why would you want to do this? Session hash is only added if cookies can not be used.
NeverBored
01-31-2010, 05:25 PM
Yes I know what it does and the ramifications. I'm mainly interested in doing this for guests only and even only a vb integrated section of my site (that I want to keep integrated and sessioned for members). I was hoping there was some way to simply kill the hash in a plugin, and I could tweak it from there to meet my needs.
NeverBored
02-03-2010, 05:13 AM
Bump
Marco van Herwaarden
02-03-2010, 07:56 AM
I still don't understand what your goal is by removing the hashes. It will break functionality if you would do that.
NeverBored
02-03-2010, 04:05 PM
What's not to understand? I don't want the session hash in the url, that is my goal. Like I said, I know the functionality it will "break", it is of no concern. I don't think I can explain what I want to do any clearer. I didn't ask what it will do to remove the hash, I even said I know exactly what it would do, I just want to know how to remove it.
ChopSuey
02-04-2010, 04:33 AM
You mean session ID in the URL ? I had a post about killing session ID's in the URL on my webmaster forum but its currently down right now. Try using Google.
When i tried to kill session ID's i always got an internal server error.
NeverBored
02-12-2010, 05:02 PM
You mean session ID in the URL ?
Yup, that's what I want to do.
Speysider
02-12-2010, 08:18 PM
You seem to be ignoring the fact that you will not be able to use your forum if you do this
ChopSuey
02-13-2010, 08:07 AM
Yup, that's what I want to do.
On one of my forums, there is a post about killing session ID's .....i'll find it and post it later.
NeverBored
02-15-2010, 08:38 PM
That would be great... I've searched around and can find various places talking about doing it but nothing that really paves the way.
ChopSuey
02-16-2010, 06:50 AM
It doesn't do "nothing" its gets stored in the MD5 doesn't it?
Here it is...
php_value session.use_only_cookies 1
php_value session.use_trans_sid 0
Add in you htaccess
NeverBored
02-16-2010, 08:05 PM
Thanks. I tried it and it gave me a 500 error.
What I originally was thinking, it seems like if you knew where $session[sessionurl] is given a value you could just cancel it out. It makes sense to me but I can't find where it's handled.
ChopSuey
02-17-2010, 12:08 AM
Its in the templates :) Navbar everywhere. Umm just search for that in templates you'll find it. Recommended its safe to have them on, when users cookies are off the sessions show up in the URL.
NeverBored
02-17-2010, 12:36 AM
I mean find where the session variable is actually given the session id, somewhere in the php files or wherever (I've looked but cant find where). Removing the session variable in the templates is an option, but I wanted to keep the functionality for members and/or only in my forum, plus that would be a PITA to remove them all from the templates.
ChopSuey
02-17-2010, 04:08 AM
Remove Session IDs.
I can give advice for PHP users, ASP and CF users should do their own research on exactly how to remove these. With PHP, if the user does not support cookies, the Session ID is automatically inserted into the URL, as a way of maintaining state between pages. Most search engines don't support cookies, which means they get a different PHPSESSID in the URL every time they visit - this leads to very ugly indexing.
There is no ideal solution to this, so I have to compromise. When sessions are a requirement for the website, I would rather lose a small number of visitors who don't have cookies, than put up with PHPSESSID in my search engine listings (and potentially lose a lot more visitors).
This will mean visitors with cookies turned off won't be able to use any features of your site that use sessions, eg logging in, or remembering form data etc.
I guess Session URL is helpful, you dont need to "remove" it.
NeverBored
02-17-2010, 04:40 AM
Thanks for trying to help.
I actually just came up with exactly the solution I was looking for.
A simple plugin using global_start
$vbulletin->session->vars['sessionurl'] = '';
$vbulletin->session->vars['sessionurl_q'] = '';
It works!
ChopSuey
02-17-2010, 10:48 PM
That turns it off?
NeverBored
02-18-2010, 12:01 AM
Yup, it removes the session id from all links. I also added a conditional so that it only happens for guests. This way when a member logs in and isn't allowing cookies, everything works completely like normal.
ChopSuey
02-18-2010, 07:31 AM
Im sure you read my post explaining what it does right? You shouldn't remove it. Oh well your choice, good luck!
Speysider
02-18-2010, 08:28 AM
Well, if NeverBored comes back saying that her forum is broken, we know why. ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.