Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 2nd, 2004, 12:45 PM
Authorized User
Join Date: Jul 2003
Location: , , .
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default Difference between Session and Response.Cookies?

Hi there

Please could someone help me with the following problem:

Our website is held in a frameset. When a Consultant logs into the site their name and userid info is held in 2 session variables and in the top frame we show the username and userid - something like 'Lucy Robinson - 44'. However, sometimes this ends up looking like ' - ' due to the problem mentioned in the link below
and all info is lost - the side frame gets a HTTP 500 error etc

Do you think i'll be able to simply change session for response.cookies and all will work?

I've never used Response.Cookies before and don't know the difference between Session and Response.Cookies.

Can anyone explain this to me and maybe help with my problem.

Thanks in advance

Old March 2nd, 2004, 02:03 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Yeah, I think you can do that with cookies. However, you may run into the same problem as with the Sessions: that IE cannot share the cookies between the page in the frameset.
If that seems to be the case, make sure you set the Expire property of the cookie. This will force IE to write the cookie to disk, so it will be available to other pages in the frame set.

A few things, though. First of all, this isn't very secure. If you're using the cookie just to display a welcome message, there isn't much of a problem. However, if user 44 is a normal user and user 1 an Administrator, it will be too easy for the user to gain access as an admin, by changing the value of the cookie.

Secondly: try ditching the frames, if possible. They are really a nineties technology, and shouldn't have a place in most modern applications. They cause more problems than they solve and all their benefits can be simulated using either Server Side Includes, or some DOM scripting.



Imar Spaanjaars
Everyone is unique, except for me.

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with cookies using response.redirect chaituat ASP.NET 1.0 and 1.1 Basics 1 March 23rd, 2006 02:54 PM
problem with cookies using response.redirect chaituat ASP.NET 1.0 and 1.1 Professional 0 March 23rd, 2006 02:09 PM
Session without cookies kumar_sampath Pro JSP 2 October 8th, 2004 10:02 AM
session management without cookies Nazu Classic ASP Professional 3 November 14th, 2003 03:46 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.