PDA

View Full Version : Reveal sessions


eksob
12-15-2005, 04:10 PM
Currently I am on a hosting solution, and they block the code from me, and have a whole administration interface. I want to see what sessions they are using to create some asp pages to work with the shopping cart.

Anyways the question is...Is their any code I can type to find out what session variables are set, and what their value is? :confused:

Thanks in advance.

BarrMan
12-15-2005, 04:27 PM
I don't think there is any way to see what are the sessions but you can try and see if the site remembers some of your details, if it does check if it is saved with cookies and if it isn't a cookie it has to be a session.

eksob
12-15-2005, 06:10 PM
yeah I know they store a cookie, but they have to store sessions to give "level" discounts for products

BarrMan
12-15-2005, 06:15 PM
why do you need it anyway? maybe there is a way to do what you want without revealing the sessions which is impossible.

eksob
12-15-2005, 06:45 PM
well, its not that I NEED it, but it would be nice. Some of their coding doesn't do what we want, so I wanted to customize the stuff, using their SQL database. Now they have level'd discounts, like a-c, level A gets more discount than level B.

When you login you are assigned the level, so when you login I am guessing a session variable is stored from an SQL server.

Its just something I was curious about...if it can't be done...than ill deal with it. thanks for your help anyways

BarrMan
12-15-2005, 06:53 PM
the level isn't saved on a session i promice you that... unless they are really stupid... it is saved in a database that includes all your details.

TheShaner
12-15-2005, 08:45 PM
Barrman, what he's talking about is that when you login, your level (which would be something like level A is for big businesses and get the biggest discount on items in their e-store since they buy more in quantity, level B would be small business, and level C be personal accounts) would be retrieved from the database and then stored in a session variable. This session passes through all your pages so that the appropriate discount can be applied when they put items in their shopping cart. This is done in many online stores.

Sorry I didn't see this post early. This code will loop through the sessions that have been set in the script:
<%
For Each x In Session.Contents
Response.Write(x & "=" & Session.Contents(x) & "<br>")
Next
%>
Also, you can always retrieve the info yourself from the DB and store it in your own session if you need to.

Hope that helps.

-Shane

BarrMan
12-15-2005, 11:10 PM
Can i count tables in database in that way too?
For each table in database
response.write table.name
next

Brandoe85
12-16-2005, 01:33 AM
Can i count tables in database in that way too?
For each table in database
response.write table.name
next

This article will give you a good idea:
http://www.4guysfromrolla.com/webtech/101799-1.shtml

Good luck;

BarrMan
12-16-2005, 09:09 AM
thanks!