12, May 2008

Cookie not being set - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  Php User Class
Topic: Cookie not being set
« previous next »
Pages: [1] Print

Author Topic: Cookie not being set  (Read 425 times)
Just another rainy day
*
Posts: 1
10 credits
Members referred : 0


« on: Dec 31, 2007, 06:10:14 PM »

Using php 5.14, phpuser v 0.91

Stuff that works:
  registration
  email activation

I can't get the cookies to save, and the $_SESSION var is not being set.

If the user logs in with appropriate user/password, I redirect to another page, but the phpuser class constructor does not pickup the session var ("userSessionValue") nor an appropriate cookie on the user's machine.

What should I look for?

Essentially, I'm doing this:

in all php files on the site, I have

Code:
require "mytemplatefile.php";

Inside "mytemplatefile.php", I have this:

Code:
require "access.class.php";

Inside "access.class.php", I have the following:

Code:
class flexibleAccess
{
      ... the class code
}

$userX = new flexibleAccess();

The act of logging in is handled like so:

Code:
if (isset($_POST['username']))      { trim(strip_tags(stripslashes($_POST['username'])));      }
if (isset($_POST['password']))      { trim(strip_tags(stripslashes($_POST['password'])));      }

if ((!empty($_POST['username'])) && (!empty($_POST['password'])))
{
if ($userX->login($_POST['username'], $_POST['password'], true, true))
{
// redirect to the home page
  header("Location: http://blahblah/index.php");
  }
  else
  {
$htmlStr .= "Invalid login attempt.";
  }
}
else
{
$htmlStr .= "You must specify a user ID and password.";
}

The problem is that when I get to the redirected page, the expected session var and cookie don't appear to exist.
« Last Edit: Dec 31, 2007, 07:47:22 PM by jsimmons »
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7491
Tags : session var Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  Php User Class
Topic: Cookie not being set
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 12, 2008, 12:42:18 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 34.925
Total Topics: 7.262
Total Members: 3.477
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: lalita

18 Guests, 4 Users online :

8 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.