Hay guys. I'm kinda new to OOP in PHP. I've learnt how to write and create objects. Is there a way to take an object and pass it to another script? either using GET or POST or SESSION or whatever. If there isn't how would i assign an object some variables on one page, then assign the same object more variables on another page?
Thanks
...
Hello!
I have a HTTPHandler that produces a Captcha image to the user whenever the captcha.ashx page is requested. The code for it is simple:
CaptchaHandler handler = new CaptchaHandler();
Random random = new Random();
string[] fonts = new string[4] { "Arial", "Verdana", "Georgia", "Century Schoolbook" };
...
Below code works fine:
<?php session_start();
$_SESSION['color'] = 'blue';
class utilities
{
public static $color;
function display()
{
echo utilities::$color = $_SESSION['color'];
}
}
utilities::display(); ?>
This is what I want but doesn't work:
<?php ses...
should I explictly send session_id as an http parameter in my ajax calls since
some browser might disable cookies?
...
I have a dilemma where to store secret tokens that I receive from twitter.
Options:
a. Put it into FormsAuthenticationTicket, encrypt it and put it into cookie. Is this secure enough?
b. Put it into Session and put user_name into FormsAuthentciation
FormsAuthentication.SetAuthCookie(String.Concat("<em>", screen_name, "</em>"), true...
I've read some articles and questions on SO (e.g. here) that say you shouldn't store a user's password in a cookie. If the password is salted and hashed, why is this insecure?
In particular, why is it less secure than using sessions, the alternative usually suggested? If the user wants to stay logged in then surely this new cookie (with...
Background
The application I am working on currently uses Spring + JPA. Everything was working fine before we decided to introduce DWR.
Using DWR I invoke a method on a Service class and it then redirects to the Controller.
try{
return WebContextFactory.get()
.forwardToString("/search.do?searchString=" + ...
Login page in flash, user will send username and password to a php file(login.php). IF login success, it will return echo "success" and create session there. Then in flash, when i click shopping button, it will go to www.domain.com/shopping/index.php, that index.php will do a session check whether the visitor has login. But it seems like...
How can <connectionStrings> in Web.config be changed without resetting sessions of logged in users?
I'd like to keep using <connectionStrings> instead of creating a custom section because I use LINQ and I don't want to have to hack my DBML.
I know that session resets can be avoided using custom sections placed in a separate file with r...
I need to implement fine-grained access control in a Ruby on Rails app. The permissions for individual users are saved in a database table and I thought that it would be best to let the respective resource (i.e. the instance of a model) decide whether a certain user is allowed to read from or write to it. Making this decision in the cont...
Right now, I can crawl regular pages using urllib2.
request = urllib2.Request('http://stackoverflow.com')
request.add_header('User-Agent',random.choice(agents))
response = urllib2.urlopen(request)
htmlSource = response.read()
print htmlSource
However...I would like to simulate a POST (or fake sessions)? so that I can go into Facebook ...
Using a user model which returns an array that looks like this:
$user_data['display_name'] = "John Doe";
$user_data['avatar'] = ./images/user144.jpg";
i create my session using $this->session->set_userdata('user_data',$user_data);
now if on another controller i let the user change his avatar,
how can i replace the session variable...
Hi Folkes,
iam a litte bit confused, i've started to learn php 5 the OO Way last year. First Projects are done with the Zend Framework.
But some of my friends are talking about storing Objects in the $_SESSION Superglobal Array. But iam not able to find an good example, why or when this is nesecarry ?
It would be great , if someone pe...
As the title said, login page should be in flash(login.swf), and the redirect to a php page (account.php). In account.php, I will need to check session, for example:
isset($_SESSION['loggedin']){
echo "Welcome back, $user";
} else {
echo "You need to login and main site";
}
Where do I generate the sessions, and where do I store it...
Hi,
I am facing an issue in handling an object in session.
I store an object in the session like this.Assume object is the name of the object.I do this in my action class
if(object!=null)
{
session.settAttribute("objectName",object);
return mapping.findForward("success");
}
else
{
return mapping.findForward("failure");
}
I map both...
I am trying to use this upload control as recommended by someone on here:
http://darrenjohnstone.net/2008/07/15/aspnet-file-upload-module-version-2-beta-1/
So I'm trying to implement a custom processor in order to store the uploaded files in the session. However, when the file is passed to the processor (from the HttpModule) the SEssi...
Help!
I'm having trouble wrestling AJAX to work for me. I have a paginated gallery with checkboxes beneath each image and I need to store the checkbox values in session variables if a user moves between the pages, so when they submit the form at any time it will include all checked values across all pages.
I'm using this jQuery code:
...
I'm having reports and complaints from my user that they will be using a screen and get kicked back to the login screen immediately on their next request. It doesn't happen all the time but randomly.
I am using CakePHP and the Auth component, which seem to work well other than this issue
I got some feedback on the Cake forums once tha...
My session seems to only be valid in the current window/tab. Also it seems to timeout quickly. Heres how I'm currently attempting to do it:
This is in my login controller:
$adapter = $this->getAuthAdapter($data);
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($adapter);
if (!$result->isValid()) {
$this->view->...
I'm building a shopping cart for a school assignment. I'm pretty much there except for adding the items to the cart variable.
I've set up my cart session with: $_SESSION['temp_session'] = array();
and then, when a item is added to the cart, this code is executed
if (isset($_POST['addtocart'])) {
$item_name = $_POST['item_name']...