Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6608407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:36:23+00:00 2026-05-25T19:36:23+00:00

i read up on the topic but have no idea where to start what

  • 0

i read up on the topic but have no idea where to start
what will the first step be? i have this code that gets called first: rclayout.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <?php include_http_metas() ?>
    <?php include_metas() ?>
    <?php include_title() ?>
    <link rel="shortcut icon" href="/favicon.ico" />
    <?php use_stylesheet('rainbow.css');  ?>
    <?php use_javascript('rainbow.js'); ?>
    <?php include_stylesheets(); ?> 
    <?php include_javascripts(); ?>
</head>
<body onload='ax_startup();'>   
<center>
    <?php
       echo "<div id='div_main_container_rc'>"; 
    ?>
<div id='div_header_container_rc'>
   <?php include_component('profile','header'); ?>
</div>
    <?php       
            echo "<div id='div_content_container_rc'>";
            echo $sf_content;
            echo "</div>";
            echo "<div id='div_footer'>";
    ?>
   //show a footer menu here
</div>  
</div> 
</center>
 </body>
 </html>

then _header.php is where it checks if a user is logged in:

<?php
$USR_IS_ADMIN = false;
$USR_AUTH     = false;

if($sf_user->hasAttribute('ADMIN'))
{
    $USR_IS_ADMIN = true;
}
    $id = $sf_user->getAttribute('profile_id');

    if($sf_user->hasAttribute('profile_id') > 0)
{   
      $profile = RcProfileTablePeer::getById($id);
      $activated = $profile->getActivated();
       if($activated == 1)
       {
        //echo "activated".$activated;
        $USR_AUTH = true;
       }
       else
       {
        //echo "NOT activated".$activated;
    $USR_AUTH = false;
        }
}
   ?>
   <?php if(!$USR_AUTH) : ?>
       //show a specific menu here   
   <?php endif;?>

  <?php if($USR_AUTH):?>
      //show a different menu here pertaining to logged in user
  <?php endif;?>

my UPDATED factories.yml file:

prod:
  logger:
  class:   sfNoLogger
  param:
    level:   err
    loggers: ~

test:
  storage:
  class: sfSessionTestStorage
  param:
    session_path: %SF_TEST_CACHE_DIR%/sessions

response: 
  class: sfWebResponse
  param:
    send_http_headers: false

mailer:
  param:
    delivery_strategy: none

dev:
  mailer:
  param:
    delivery_strategy: none

all:
  routing:
  class: sfPatternRouting
  param:
    generate_shortest_url:            true
    extra_parameters_as_query_string: true

  view_cache_manager:
    class: sfViewCacheManager
    param:
      cache_key_use_vary_headers: true
      cache_key_use_host_name:    true

user:
  param:
     timeout: 300

where must i start how will i do this? i dont see a session set anywhere
do i configure the php.ini file and if so how? or do i do this with a session?

please help?
thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:36:23+00:00Added an answer on May 25, 2026 at 7:36 pm

    By default PHP uses the PHP session mechanism. This session is configurated through the factories.yml. The default configuration is like this:

      user:
        class: myUser
        param:
          timeout:         1800
          logging:         %SF_LOGGING_ENABLED%
          use_flash:       true
          default_culture: %SF_DEFAULT_CULTURE%
    

    So, by default, the session will automatically time out after 1800 seconds (= 30 minutes).

    Your own factories.yml overrides the default factories.yml from Symfony (which can be found in /lib/vendor/symfony/lib/config). In that factories.ymlthe user factory is defined like above.
    So if that configuration is sufficient for you, you don't have to anything. If you want to change the timeout, you can override the appropriate lines in your own
    factories.yml. In that case you can add to following lines to your ownfactories.yml`:

      user:
        param:
          timeout:         900  # log out after 15 minutes
    

    Oh, and I really, strongly, recommend you to keep the logic out of the view in _header.php. All the PHP code with the if/else structures should be in the components.class.php, and te view (_header.php) should be only view data.

    So something like this:

    Controller:

    // components.class.php
    public function executeHeader() {
    
        // code here...
        $this->isAuthenticated = true/false;
    } 
    

    View:

     <?php if ($isAuthenticated): ?>
     ...
     <?php enif; ?>
     <?php if (!$isAuthenticated): ?>
     ...
     <?php enif; ?>
    

    Much cleaner, and it seperates the view from the logic… 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read other questions on this topic but none that actually answers my
I only read a little bit about this topic, but it seems that the
I have read a few bits and bobs online about this topic but found
I have read many Forums on this topic but I still haven't found an
I know that there have been plenty of topics describing this topic but I
I have read through some articles on this topic but I am still cautious
I have read a lot of related topics here regarding this problem but I
I've read many answers here about this topic, but everyone suggests the BCP ||
I've read the other posts here about this topic, but I can't seems to
I've already read through the similar questions on this topic, but none of them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.