usafrmajor Posted February 21, 2007 Share Posted February 21, 2007 What settings do I need to change below to get my $_SESSION variables to work? I have tried many thing and restarted my Apache server as many. Please help. thanks Alan ================================ session.save_path = "" session.name = "PHPSESSID" session.save_handler = "files" session.auto_start = "0" session.gc_probability = "1" session.gc_divisor = "100" session.gc_maxlifetime = "1440" session.serialize_handler = "php" session.cookie_lifetime = "0" session.cookie_path = "/" session.cookie_domain = "" session.cookie_secure = "0" session.cookie_httponly = "0" session.use_cookies = "1" session.use_only_cookies = "1" session.referer_check = "" session.entropy_file = "" session.entropy_length = "0" session.cache_limiter = "nocache" session.cache_expire = "0" session.use_trans_sid = "0" session.bug_compat_42 = "1" session.bug_compat_warn = "1" session.hash_function = "0" session.hash_bits_per_character = "4" url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=" Quote Link to comment Share on other sites More sharing options...
usafrmajor Posted February 21, 2007 Author Share Posted February 21, 2007 The specific problem I am having is getting the values to be seen from page to page. I can see a session variable within a page, but when ever I try to see one set on one page in a second page I get nothing. thanks Alan Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted February 22, 2007 Share Posted February 22, 2007 The default setting are fine. You cannot turn session on or off. They are part of PHP's core. When using sessions make sure your have session_start(); on the first line of each page that uses sessions and that your web browser accepts cookies. If you dont have session_start(); as the first line of each page that uses sessions your session variables will not transfer from page to page. Alss make sure you are not outputting anything before you call session_start either. This should work: <?php session_start(); $_SESSION['mySessVar'] = 'someValue']; ?> Session variable set! <a href="file2.php">Next page</a> <?php session_start(); echo $_SESSION['mySessVar']; // -- output: 'someValue' ?> Quote Link to comment 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.