Session not working in FireFox

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Session not working in FireFox

Post by susrisha »

Hi all ..

I am trying to develop a web site where for each of the page, i am trying to check if the user is logged in using session. Here is a sample code for checking if the user is logged in..

Code: Select all

 
 
<?php
if(!isset($_SESSION))
{
session_start();
}
//see if the user is authenticated
if($_SESSION['authenticate']!="1")
{
     session_regenerate_id();
     session_destroy();
     include_once("Login_templ_start.php");
     echo '<FONT COLOR="#FF0000 "><b>Unauthorized login.. Please Login again</b></FONT>';
     include "loginbody.php";
     include "template_end.php";
 
    exit();
}
//further code  of the page..
?>
 


It all works fine with IE and Chrome but the session doesnt seem to work in Firefox version 3.0.3. Even when the user logs out, it still gives access to the pages where i am checking for an authentication.

Can anyone help me fix this problem?? if i am not clear .. please post the same.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Session not working in FireFox

Post by s.dot »

Hmm, try putting in unset($_COOKIE[session_id()]);.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: Session not working in FireFox

Post by susrisha »

where do i put the code u have suggested??
Post Reply