remove PHPSESSID from url (htaccess)

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi there
I have a site in which all pages ARE php-pages, but
they're called/manipulated with htaccess.

All files appear as a html-file to surfers.
Sometimes i get the PHPSESSID declared in the url.
I want to avoid this from caching in the browsers

is there a way to detect if PHPSESSID is set, and if
so redirect the user...

RewriteRule ^(.*)?(\?)?(\&)?PHPSESSID=([a-zA-Z0-9]+)?$ index\.php\?$1

doesn't work.. :(

i can't find a good way to get what i want..
can someone help me?


Re: remove PHPSESSID from url (htaccess)


Quoted text here. Click to load it

The ini value: session.use_only_cookies should = 1.
This way it will only use cookies no PHPSESSID in the url.

Quoted text here. Click to load it

If you are using sessions you do not want to ripout the session url.
Now the backside to this whole thing is if the browser does not accept
cookies then you will not be able to monitor there session data as they
will need to always relogin or have a new session every page.


Re: remove PHPSESSID from url (htaccess)

Mike Willbanks wrote:
Quoted text here. Click to load it


( or )

  <?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com    Blog: /

Site Timeline