• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1271
  • Last Modified:

how to pass session variable from .aspx page to .asp (classic asp) page

Hi,
I need to pass session variable from .aspx page to .asp.
I can't use query string or cookies,i need session variable only.
Please can you say me how to do this.

.aspx:-
---------
Session["Login"]="Had Value";   
 
asp:-
-------

Open in new window

0
ravindra333
Asked:
ravindra333
  • 4
  • 3
2 Solutions
 
abelCommented:
you cannot pass the whole session, of course. If you just want to pass a session variable, and you do not want to use a query string nor cookies, you have already ruled out the most important methods of passing on information.

Instead of the querystring you can use POST information and use an input type hidden for your data. But this still passes by the client side, of course, which I assume you do not want.

Other alternatives require more work:

  1. Store the sessions in a database. You can configure this in IIS for sessions and you can access the database through ASP using the normal way you access databases. Then just pass the token in a hidden field and you should be fine
  2. Create a simple interface, only accessible from server-to-server (not from client) and use the XmlHttpRequest object in ASP to access the interface you defined. This is more work, but you have the most control.
-- Abel --
0
 
Saqib KhanSenior DeveloperCommented:
0
 
abelCommented:
@adilkhan: that is from Classic ASP to ASP.NET. The original poster wants it the other way around: from his ASPX (i.e. ASP.NET) page to Classic ASP....
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Saqib KhanSenior DeveloperCommented:
Well then he can do other way around. ASPX page submits to a hidden Page, Populate Hidden Fields & Then Submit that form to a ASP Page, and repopulate the Session.
0
 
abelCommented:
sounds good, but remember the original question: the OP doesn't seem to want any of this sensitive data passed on through to the client's browser. Which is why I suggested to use the same method you propose, but then entirely on the server, hidden from browser requests.

but those are just my thoughts. I'd be interested in what the thoughts of the op are on the subject :)
0
 
abelCommented:
Sorry, but you shouldn't delete questions that have a constructive discussion thread, which actually show you a solution to your original problem. If you have chosen a different path, that's good, but the solutions are still viable for others having the same problem. Please read closing a question if you have problems understanding the closing process.

My suggestion: split points between me (comment #24172591) and adilkhan (comment #24174028), both gear towards a solution to the original problem.
0
 
Saqib KhanSenior DeveloperCommented:
Agreed with abel.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now