Stephen68 Posted February 17, 2008 Share Posted February 17, 2008 Hello I'm not really sure if this is where this post should go, if not I'm sorry I am hosting my site with ipowerweb.com and was wondering if anybody here has done the same? The problem I'm having is getting session to set, once I go to another page they are gone. On their FAQ's they tell me that I have to set session_save_path to a directory in my account which I did. session_save_path("/home/users/web/tome/accouct/directory/public_html/cgi-bin/tmp"); This still does not work? Below is a simple code that should set a session and then a link to the next page. <?php // page1.php session_save_path("/home/users/web/b388/ipw.littles/public_html/cgi-bin/tmp"); session_start(); $_SESSION['favcolor'] = 'green'; $_SESSION['animal'] = 'cat'; $_SESSION['time'] = time(); ?> <html> <head> <title></title> </head> <body> <?php // Works if session cookie was accepted echo '<br /><a href="session.php">page 2</a>'; echo"<p>"; echo $_SESSION['animal']; ?> </body> </html> And here is the page that the link points to... <?php session_save_path(/home/users/path/to/my_dir/public_html/cgi-bin/tmp); SESSION_START(); ?> <html> <head> <title>Hello!</title> </head> <body> <?php echo $_SESSION['animal']"; echo $_SESSION['favcolor']"; echo $_SESSION['time']"; ?> </body> </html> Maybe I'm doing something wrong I'm not sure, hope that somebody can hehe.. Thanks for your time guys Stephen Link to comment https://forums.phpfreaks.com/topic/91521-php-session-ipowerweb/ Share on other sites More sharing options...
trq Posted February 17, 2008 Share Posted February 17, 2008 You have errors in your second file, should be... <?php echo $_SESSION['animal']; echo $_SESSION['favcolor']; echo $_SESSION['time']; ?> Link to comment https://forums.phpfreaks.com/topic/91521-php-session-ipowerweb/#findComment-468792 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.