Jump to content

server generating session in links and forms


MrAdam

Recommended Posts

i wasn't sure where to post this, as i wasn't sure how it would be fixed.I'm trying to get my webpage to validate as strict XHTML, there's 1 or 2 errors i know how to fix, but this one i'm not sure...basically, the server appears to be generating "PHPSESSID=blahblah" (sometimes) on links and forms. Of course this means it's using "&PHPSESSID=blahblah" which means it's not validating.http://www.minimerc.co.uk/new/shop.php?c=E...amp;m=W114-W115 (not much works yet so no point in trying to view other pages)How can I stop the server from doing this (i have .htaccess rights, but cannot change the server configuration directly)- Thanks!

Link to comment
Share on other sites

Im pretty sure that those are on all links because of the shopping cart, this is so it can store the users info in the database. You should check the shopping cart script for anything that has that part of the link. So just look around for those.

Link to comment
Share on other sites

nar - thanks for the help - but it's the way the server is setup, occasionally it seems to pop the session into the link or form, where as on my server it never does. I've seen people using a function I can't remmeber the name of, to modify the confirguration in a particular script...

Link to comment
Share on other sites

That is a session configuration option. If cookies are not available or can't be used, PHP will put the session ID in URLs. If you want to disable that, so that only cookies are used and not the URL, use this on the top of each page:ini_set("session.use_only_cookies", 1);

Link to comment
Share on other sites

Try setting the trans_sid to 0 instead of 1, I wasn't clear on what that directive does. But you might also not be able to set that directive during runtime. Try adding this instead:ini_set('url_rewriter.tags', '');That will probably work, and you can also try to put a php.ini file in the same directory as your scripts with the session.use_trans_sid and session.use_only_cookies directives in it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...