rkelsey Posted February 16, 2007 Share Posted February 16, 2007 I'm trying too make this website for a client (http://300seconds.freehostia.com/). The problem is the PHPSESSID comes up the first time a user clicks a link. After that it disapears. My website does use sessions to store user login information. I'm relatively new to PHP so can you try and explain as you go along? Much apreciated! Link to comment https://forums.phpfreaks.com/topic/38758-remove-phpsessid-from-url/ Share on other sites More sharing options...
printf Posted February 16, 2007 Share Posted February 16, 2007 The problem is a common one. A session cookie doesn't get picked up until a refresh or a redirect, so setting a cookie on page A, needs to go to page B or refresh page A, in order to set the cookie. So your software or PHP config (trans_id) is setting the url session until the cookie gets set. There are ways around this, but that has to do with controlling the complete session process and defining a user login as apposed to just a visitor using the site! But the key is controlling the session and not using the core PHP session handler. Link to comment https://forums.phpfreaks.com/topic/38758-remove-phpsessid-from-url/#findComment-186223 Share on other sites More sharing options...
rkelsey Posted February 16, 2007 Author Share Posted February 16, 2007 I think i get what you mean, all accept the last bit: the key is controlling the session and not using the core PHP session handler. Otherwise, i dont mind the PHPSESSID being there, but maybe i can do something like this in my .htaccess file: RewriteRule ^site/(.*)/(.*)\.htm index.php?PHPSESSID=$1&page=$2 in which case i'd like to keep the PHPSESSID there always. I just dont want the PHPSESSID to be appended after the ".htm" really, because A) it spoils the "illusion" and B) it doesn't look that great. If I wanted to keep it there always, how would I do that? (Ideally, how do I hide it from the URL though?) Link to comment https://forums.phpfreaks.com/topic/38758-remove-phpsessid-from-url/#findComment-186435 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.