Jump to content

Recommended Posts

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="

 

Link to comment
https://forums.phpfreaks.com/topic/39404-getting-_session-variables-to-work/
Share on other sites

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'

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.