Baabu Posted February 29, 2008 Share Posted February 29, 2008 <?php //require 'db.php'; include ("functions.php"); include ("session.php"); //header("Location:http://localhost/cart/index.php"); //exit(); // echo $_POST["username"]; //echo "<br>"; // echo $_POST["upass"]; session_start(); if(AuthenticateUser($_POST["username"],$_POST["upass"])) { session_register("username"); $username=$_POST["username"]; echo $_SESSION["username"]; echo GetCartId(); //echo session_id(); //$uname=$_POST["username"]; //$upass=$_POST["upass"]; //setcookie("cookie_passwd",$upass); //setcookie("cookie_user",$uname); //echo "cookieset"; ?> <script language="JavaScript"> <!-- window.location.replace("list.php"); //--> </script> the above code is working fine i m not concerned abt security issues just want to knw when i redirect the page with java script no session or cookie variable is set on next page i.e list.php any suggestions?? Link to comment https://forums.phpfreaks.com/topic/93673-no-session-or-cookie/ Share on other sites More sharing options...
moon 111 Posted February 29, 2008 Share Posted February 29, 2008 You are being very vague. Please explain yourself. Link to comment https://forums.phpfreaks.com/topic/93673-no-session-or-cookie/#findComment-479929 Share on other sites More sharing options...
Baabu Posted February 29, 2008 Author Share Posted February 29, 2008 well i just want to pass the session variable "username" after the authenticate functions comes true and then the page should redirect to list.php where i want the user name to be display but after the authenticate function goes true Link to comment https://forums.phpfreaks.com/topic/93673-no-session-or-cookie/#findComment-479932 Share on other sites More sharing options...
conker87 Posted February 29, 2008 Share Posted February 29, 2008 Lets have a look at list.php Link to comment https://forums.phpfreaks.com/topic/93673-no-session-or-cookie/#findComment-479958 Share on other sites More sharing options...
Baabu Posted February 29, 2008 Author Share Posted February 29, 2008 well i figured it out just placed session_start() just as the script starts and it all worked fineĀ Link to comment https://forums.phpfreaks.com/topic/93673-no-session-or-cookie/#findComment-479969 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.