BoarderLine Posted February 16, 2011 Share Posted February 16, 2011 PHP 5.3.3 I am trying to redirect a user (currently logged in) to a page where they are able to edit a posted comment. To keep things secure I am using a forms hidden input value to pass the {postID} to a redirect page <form name="post_edit" method="post" action="post-edit-redirect.php" > <input type="hidden" name="local" id="local" value="<?php echo $row_rsPosts['postID']; ?>" /> <input type="image" src="../imgs/managepost.png" name="submit" /> </form> On the redirect page (simplified below) I am setting the {postID} in a SESSION before redirecting to the user to the page to edit their post with the new $_SESSION val for {postID} set. session_start(); $id = $_REQUEST['local']; $_SESSION['postID']=$id; header("Location: edit-post.php"); This is working fine in every browser except IE (some one please just put an end to it), where when the edit-post.php page is reached the $_SESSION['postID'] is empty. If I regenerate the session ID from the redirect page as below IE then sets the SESSION ok. session_start(); session_regenerate_id(); $id = $_REQUEST['local']; $_SESSION['postID']=$id; header("Location: edit-post.php"); However there should be no need to do this and would rather not if there is no need. Any help on why IE is not setting the SESSION is appreciated, and I hope I am not covering old ground here however I am unable to find a solution anywhere. - Cheers Quote Link to comment https://forums.phpfreaks.com/topic/227916-_session-value-not-being-set-ie-only/ Share on other sites More sharing options...
ManiacDan Posted February 16, 2011 Share Posted February 16, 2011 Sessions are based on cookies. Check your cookie settings. Quote Link to comment https://forums.phpfreaks.com/topic/227916-_session-value-not-being-set-ie-only/#findComment-1175263 Share on other sites More sharing options...
BoarderLine Posted February 16, 2011 Author Share Posted February 16, 2011 Here are my settings, which seem to have worked well up till now: Session Support enabled Registered save handlers files user Registered serializer handlers php php_binary wddx Directive Local Value Master Value session.auto_start On On session.bug_compat_42 Off Off session.bug_compat_warn Off Off session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_httponly Off Off session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 1000 1000 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.hash_bits_per_character 5 5 session.hash_function 0 0 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path /var/lib/php/session /var/lib/php/session session.serialize_handler php php session.use_cookies On On session.use_only_cookies On On session.use_trans_sid 0 0 Quote Link to comment https://forums.phpfreaks.com/topic/227916-_session-value-not-being-set-ie-only/#findComment-1175284 Share on other sites More sharing options...
BoarderLine Posted February 17, 2011 Author Share Posted February 17, 2011 Also if my cookie settings were not correct then other browsers would also fall over on this.... No no, I am now convinced that the reason that this is not working is because IE is S#*t. Quote Link to comment https://forums.phpfreaks.com/topic/227916-_session-value-not-being-set-ie-only/#findComment-1175467 Share on other sites More sharing options...
cgsmith105 Posted February 17, 2011 Share Posted February 17, 2011 BoarderLine, Why are you using sessions for an 'Edit Post' feature? Did you do a var_dump() on $_SESSION and $_REQUEST? Can we see more code? Quote Link to comment https://forums.phpfreaks.com/topic/227916-_session-value-not-being-set-ie-only/#findComment-1175504 Share on other sites More sharing options...
ManiacDan Posted February 17, 2011 Share Posted February 17, 2011 Check your cookie settings in internet explorer. Quote Link to comment https://forums.phpfreaks.com/topic/227916-_session-value-not-being-set-ie-only/#findComment-1175690 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.