jakebur01 Posted July 3, 2007 Share Posted July 3, 2007 hey, sometimes the phpsession id pops up after the url occasionally. It comes and goes, especially after you wipe out you cache. Is there any way to prevent this from happening? <?php include ('book_sc_fns.php'); // The shopping cart needs sessions, so start one session_start(); do_html_header('Welcome to !'); // echo '<font color = #FF0000> <p><b>Select a category below or a brand from above.</b></p></font>'; ?> <?php echo "<TABLE BORDER=1 bgcolor=#FFFFFF bordercolor=RED bordercolorlight=#33CCFF bordercolordark=RED CELLSPACING=1 ALIGN=left>"; echo "<tr><td>"; echo "<b>Please select a category below</b>"; // get categories out of database $cat_array = get_categories(); // display as links to cat pages display_categories($cat_array); echo "</tr></td>"; echo "</table>"; ?> <?php // if logged in as admin, show add, delete, edit cat links if(isset($_SESSION['admin_user'])) { display_button('admin.php', 'admin-menu', 'Admin Menu'); } do_html_footer(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/58296-solved-url-acting-crazy/ Share on other sites More sharing options...
wcsoft Posted July 3, 2007 Share Posted July 3, 2007 Normally this is controlled by a couple php settings: use_trans_sid and user_only_cookies. If you have access to your php.ini file you can change the first to 0, and the second to 1. If you don't have access to the php.ini but your host allows you to use htaccess, you could create an .htaccess file with the following: php_value session.use_trans_sid 0 php_value session.use_only_cookies 1 Quote Link to comment https://forums.phpfreaks.com/topic/58296-solved-url-acting-crazy/#findComment-289036 Share on other sites More sharing options...
jakebur01 Posted July 3, 2007 Author Share Posted July 3, 2007 Will this affect the functioning of my site in any way? Will I just include that htaaccess file on all of my pages or what? Quote Link to comment https://forums.phpfreaks.com/topic/58296-solved-url-acting-crazy/#findComment-289041 Share on other sites More sharing options...
wcsoft Posted July 3, 2007 Share Posted July 3, 2007 You'd just need to put that into your root html directory and you should be good. It shouldn't affect your site at all as it just tells php how to track session ids, basically making sure to track them via cookie and not in the URL. Quote Link to comment https://forums.phpfreaks.com/topic/58296-solved-url-acting-crazy/#findComment-289045 Share on other sites More sharing options...
jakebur01 Posted July 3, 2007 Author Share Posted July 3, 2007 will i have to change anything in my sites code like[setcookie()] or anything like that. or will sessionstart() automatically store the session on the users computer for me? Quote Link to comment https://forums.phpfreaks.com/topic/58296-solved-url-acting-crazy/#findComment-289055 Share on other sites More sharing options...
per1os Posted July 3, 2007 Share Posted July 3, 2007 session_start() will handle it. I suggest running some tests first on a localhost server just to see how it will work before trying to implement in a production environment. Quote Link to comment https://forums.phpfreaks.com/topic/58296-solved-url-acting-crazy/#findComment-289057 Share on other sites More sharing options...
wcsoft Posted July 3, 2007 Share Posted July 3, 2007 Nope, the session handler will deal with the cookies, so no code changes necessary. I can't guarantee this change will fix the problem, but it sounds like it may be the culprit. Quote Link to comment https://forums.phpfreaks.com/topic/58296-solved-url-acting-crazy/#findComment-289058 Share on other sites More sharing options...
jakebur01 Posted July 3, 2007 Author Share Posted July 3, 2007 I will check it out. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/58296-solved-url-acting-crazy/#findComment-289062 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.