cookies

How do I create a persistent vs a non-persistent cookie?

I can't seem to figure out how to create a persistent vs a non-persistent cookie. How do they differ, say, in the HTTP headers that are sent back? ...

Facebook iframe not working in IE; session/login issue?

I have an issue with my Facebook canvas iframe application. I'm using sessions to build a simple questionnaire-style application. There's a question on each page, when the form is submitted the answer is stored in a session array, and the page number is incremented by one, which then displays the next question. Simple stuff. This app, ...

Zend Framework - storing and retrieving cookies

I try to put the user's email in a cookie when he logs in, and retrieve it at his next visit. The code below doesn't work, obviously I am missing something. When user submits login info, store the email in cookie: $cookie = new Zend_Http_Cookie('emailLogin', urlencode($email), 'localhost'); At the next user's visit, retrieve the user'...

Sessions with multi-subdomain on ASP.net MVC2

We're currently building a Webapp that serves multiples subdomains (wildcard subdomain). In our app, users may be authenticated for one or many subdomains (just like Basecamp does). We want to know what's the best strategy to save and load users credential. The main problem is that our users may have differents roles in differents s...

Setting cookies using Javascript in IE8

I want to set cookies using javascript that should not expire for some time. I create the cookie using the code below. These cookies are available in firefox across browser session (browser restarts). However, all cookies seem to get lost in IE. I want to set the cookie using javascript only. I alerted document.cookie on page load. In a...

Setting custom cookies in firefox and chrome?

Is there a way to add a cookie in these? Like "debug=true" and that way my website can test for that? I'm meaning to be able to use the ui of the browser. Maybe a plugin/extension? Basically, I want to be able to test certain features without anyone else seeing them. ...

Remember me login - Asp script

hello i have to create a "remeber me login" asp script, have read many scripts about this procedure and have see that many people use to store username and password inside a cookie. In my opinion it is not secure (safety), some advice ...

Forcing .net Login control to make the user logout if a cookie is null..

I have a code base web application that is connected to 2 databases. Depending on which login control a user uses to login, a different database is connected to the code. I am doing all of this by a cookie. This cookie is in a public class called AuthenticatedUser. The class looks like this: public class AuthenticatedUser : System.W...

ASP.NET: Cookies, value not being reset, cookie not being removed

I have a cookie called "g" with values "y" or "n" I set it like this: Response.Cookies("g").Value = "y" Response.Cookies("g").Expires = DateTime.Now.AddHours(1) I change it like this: Request.Cookies("g").Value = "n" and I try to destroy it like this Response.Cookies("g").Expires = DateTime.Now.AddHours(-1) The cookie gets set ...

Where create cookie that holds only user id in Zend MVC project?

Hi, I am working with Zend MVC project. MY mission: add cookie that will have only user unique id. Problem:I don't know where create a cookie. Options to place create a cookie, that I thing about: bootstrap.php init()/run() index.php (not make sense) In Controllers My project structure: application/bootstrap.php public/index.ph...

ASP.Net output caching annoyance

In our ASP.Net site we only allow users in from certain countries by checking and filtering their IP address by range. One of the features of the site is we have a bypass IP check query string argument. This argument just sets a bypass cookie in case they click other links beyond the initial landing page which we can check to keep the by...

How do you remove HttpOnly cookies?

If my application places HttpOnly cookies on a client and then needs to remove them how can you remove them completely? ...

How can I send cookies with Perl's LWP::Simple?

use LWP::Simple; use HTML::LinkExtor; use Data::Dumper; #my $url = shift @ARGV; my $content = get('example.com?GET=whateverIwant'); my $parser = HTML::LinkExtor->new(); #create LinkExtor object with no callbacks $parser->parse($content); #parse content now if I want to send POST and COOKIE info as well with the HTTP header how can I co...

"Can't use function return value in write context" error in PHP

Fatal error: Can't use function return value in write context in line 3, In which cases such errors get triggered? My program: //QUERY VARIABLE $query="select * form user where user_name='$user_name' and user_password='sha($user_password)'"; //ESTABLISHING CONNECTION $result=mysqli_query($dbc,$query)or die('Error Query...

Jquery Menu remembering the state of the menu.

Hello, I am trying to get my menu system to read a cookie to it can remember the menu state. once remembered the menu would stayopen/close depending on the cookie. using alert in the javascript ive been able to read the cookie before and after clicks but sadly I cannot get the if statement correct in order to keep open/close the hidden...

How can I set the value of this cookie property from code behind?

I would like to do this: Dim str As String = class.isGuest("yes") but it won't work. Public Property IsGuest(ByVal guestStatus As String) As String Get Dim guestCookie As New HttpCookie("g") For Each key As String In Context.Response.Cookies.Keys If key = MYACCOUNT_SESSION_COOKIE_NAME Then ...

persistent content when visiting other page in (persistent toggle) jQuery

When I change content of a site using toggle, or which ever other function, the state is not saved. So, if this is my page: <div id='test'></div> <input type='submit' value='test'> <a href='http://www.stackoverflow.com'&gt;link to elsewhere</a>​ and this is in my ready-code: $(':submit').click( function() { $('#test').text( 'this i...

ASP.NET 2.0 Profiles - How do I prevent records from being created for users who don't accept cookies?

I am using ASP.NET profiles with allowAnonymous="true". I am NOT using ASP.NET membership. I recently took a hard look at the aspnetdb database and noticed that although my site gets 600-800 unique visitors daily, there are 4000-5000 "users" being created in the database. Clearly what is happening here is the users with cookies disabled...

Dumb question about cookies

I have little experience with web programming and I am implementing an interface where I sent a HTTPS POST Request (with user/password), receive a XML, then I send another HTTPS POST Request (with an additional "passcode" dependent on the XML), receive a XML, (then I am logged in) then I send a HTTPS GET request and get an XML (the data ...

Why isn't my Java HttpServlet able to find my cookie's value?

I've created two servlets: UserReceiverServlet receives a username from a form. It then sets the username to an attribute and forwards the request to UserDisplayServlet. UserDisplayServlet will add the username to a cookie and then display the current continents of both the attribute which was set and the cookie which was stored. How...