Hey I'm new to PHP so would really like your insight on how I'm programming and also I'm having trouble coming up with a solution for a session problem.
I'm making a script for a bartering and Local Trade System (LETS) and I'm currently coding the offer page where the user can view all products/services on offer and then click on a pro...
All,
I have a PHP5 web application written with Zend Framework and MVC. This application is installed on 2 servers with the same setup. Server X has php5/MySql/Apache and Server Y also have the same. We don't have a common DB server between both the servers.
My application works when accessed individually via https on Server X and Serv...
Can anyone explain me, why in the session in this case we get the object with 2 properties?
set_error_handler('my_error_handler');
session_start();
$obj = new myclass();
$_SESSION['obj'] = $obj;
$a->b();
class myclass
{
private $a = 1;
private $b = 2;
public function __sleep()
{
return array('a');
}
}
...
((List<string>)Session["answera"]).Add(xle.InnerText);
I need to perform this operation, but I get "Object reference not set to an instance of...."
I don't want to use
List<string> ast = new List<string>();
ast.Add("asdas!");
Session["stringList"] = ast;
List<string> bst = (List<string>)Session["stringList"];
as I mer...
I need to set, automatic session time out after some fixed time in my site.
I used the script below but it's not working properly.
I set the some time but it automatically times out before that time.
if((empty($Session_UserId)) || (empty($Session_Username)))
header("Location:index.php");
if($_SESSION['session_count'] == 0) {
$_SE...
Firstly, no OAuth or other things supported in the server-side, just a normal username-password database querying.
I want to implement an android client for the web site. My questions are:
How to login safely? with HTTPS?
How to store user login information safely in the phone to make user login without any input in the next time.
If ...
Hello All,
I have weirdest problem with PHP itself, that I've ever seen.
Setup:
PHP 5.33, (tried PHP 5.2.14 as well) under IIS
Problem:
PHP deletes all session data as soon as I put exclamation point into a key in session array.
Example:
session1.php
session_start();
$_SESSION["foo"] = 'test';
header('Location: session2.php');
s...
I would to set it up where if someone sends in a request "logout" it will automatically take them to a page saying "successful log out". If the customer tries to press the back button or go to the restricted area, it will ask for HTTP auth again.
What I have so far is this:
example.com/restricted/index.php:
<?php
session_start(...
i have implemented the the openid in my page using dotnet open id when i get authenticated iam storing the details provided by openid provider in my database and creating a session of that username and redirecting the user to login protected page it is working fine but some time if i left the page idle for some time and then do any kind ...
Hello,
My application consists of two views, list and detail.
Basically when user double-clicks a row from a list, I pass selected item object to detail view.
Every instance of view has it's own NHibernate session.
When user modifies object properties, my list view needs to reflect changes, to do this I implemented INotifyPropertyCha...
so i need a cookie set for 21 days on a browser when a user hits the site and everytime the user returns in that 21 day period i need to retrieve that value
if($_REQUEST['ref'] == "something"){
setcookie('something_value', "something" ,time()+60*60*24*21,'/','mydomain.com');
}
in the view
<?php if(isset($_COOKIE['something'])) { ?...
How can I tell how many open sessions there are on a Glassfish v2 server? Is there something in the admin tool?
Thanks
...
Hi there,
I'm running a Django app for my root public_html folder, and it's working fine. But there's a problem with one of my other apps. The problematic app is accessed through a redirect to a subdirectory (e.g. http://workingsite.com redirects to public_html, http://brokensite.com redirects to public_html/foo)
The problem is that th...
Which storage method should I use when using ASP.NET Charting Tools? I'm currently using memory, because it seems like the most straight-forward and easy to implement option. Is there any reasons I should be aware of why I should choose one of the other options?
The charts generated will be useful only for an overview kind of purpose ...
Reading conflicting opinions on using SQL session state vs custom db table in MVC to store user data across page requests?
What are the advantages and disadvantages to each method? Why should I pick one method over the other.
So far it seems a custom db table is the best solution because it doesn't time out, plus it would be strongly t...
Hello all,
I'm using Seesion in my project that stores the useTypeID (admin, manager and so on) and for the backoffice only the admin and the manager can enter, so in every page in my backoffice in the first line i check if the seesion is stile alive and only then the user can enter the page:
if (!EmployeeSession.IsAuthenticated || Empl...
I'm planning the development of a website which will use parked domains to allow a single code base to drive multiple locale versions of a website.
What I have in mind is, when my index page is loaded to query my database to see if that particular host name has been added to a white list via a bespoke administration system. If so, the r...
Hi
I have implemented NHibernate custom context (ICurrentSessionContext).
In this context I inject the NHibernate session so I have Session per call pattern setup.
Ok, now I have made an interceptor that takes userId of the current logged user.
Now I do this:
public ISession CurrentSession()
{
// Get the WCF InstanceContext:
var con...
hey guys I'm trying to create a timer which counts the time spent on a page using a thread heres what I have so far:
<cfset session.time=0>
<cfthread name="timer" action="run">
<cfscript>
counter = 0;
while (counter <9000) {
sleep(1000);
session.time++;
counter ++;
}
</cfscript>
</cfthread>
page 2:
<cfoutput>#session...
Possible Duplicate:
Is this a proper way to destroy all sessions in php?
Hey Guys,
what's the best way to destroy all sessions (not just the one of the current user).
Thanks in advance!
...