Jump to content

Recommended Posts

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

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.