Referencing variable in calling class?



Hi All,

I'd like to reference the value of a variable in a class that called the
current piece of code via a require_once.

In essence, I have a 'front controller' class that builds the page to be
displayed depending on several criteria.

One issue I'm having is that when a user logs out of my application, I
destroy the cookie that indicated the user was logged in during my preRender
process, and then go onto display the 'logged out' page. Unfortunately, I
have a page element that indicates whether the user is logged in or not, and
I assume because the cookie destruction is being sent down in that page
request, when that page renders it still appears as if the user is logged
in, because the cookie still exists until after that page is rendered.

So, I thought perhaps as part of my logout routine, I could set a variable
that my 'are you logged in or out' code could check and use to override
whether or not it displays the 'login' url or the 'logout' url.

I thought that in that code I should be able to check the value of a public
variable that is in my front controller class, but it appears I can't?

So, pseudo chain of processing would be something like this:

- call index.php
- instantiate front loader class
- perform pre-render processing, if logging out, set public variable in
class to true
- call actual page to be rendered via require_once
- in page being rendered, call function from separate file that displays
'login / logout' url
- in that function test public variable in front controller class to see if
true
- if true, regardless of whether or not the cookie still 'appears' to exist,
display 'login' url because user has logged out

However, am I right in thinking that the function that displays the login /
logout url is actually unaware of the existence of the front controller
class at the point at which it is being called?

M is for Murray


Relevant Pages

  • Cant remove cookies!
    ... I have a login page where if the user wants his access codes to be saved are ... In the logout page, I want to delete those cookies. ... How do we remove user's cookie? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Cookies Expiring due to different time zones.
    ... post to your aspx login, sending the cookie's date in a hidden field ... set the aspx login cookie using the date/time in the hidden field ... This is the code I am using to create the ticket, ... Your problem is that you're using an extremely short time for the cookie expiration. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Accessing and displaying SSL web pages and cookies from a windows form
    ... or LoadXML calls to urls on the website in order to get data or post data to ... first redirected to a SSL login page, if a particular cookie is not present, ... cookie is not present instead of getting the data. ... >> the data in the cookie and also not redirect to the login page. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: [PHP] Need secure login
    ... Thanks Justin, actually I was also thinking of the same, but just wanted to ... > c) the user not deleting the cookie ... > Likewise, you can't tie a member to a mac address, or to an IP address. ... Make sure that a user can't login from two different places at ...
    (php.general)
  • Re: OWA does not logout for IE 6.0 - Security Issue
    ... Configure the /exchange directory to use basic authentication and it will ... I have read the posts about the problems with OWA and the login prompt ... But now I need to login as a different user, so I click the Logout ... will leave behind a pre-logged in Exchange account. ...
    (microsoft.public.exchange.setup)