Forum Home
Press F1
 
Thread ID: 60196 2005-07-25 13:40:00 700,000 developers lookout. Session Abstraction layer for ASP CreightonBrown (5692) Press F1
Post ID Timestamp Content User
375287 2005-07-25 13:40:00 Layer 4 would be Session Translator
Layer 3 would be 'Session Interpreter' Page/Session Insertion & Output with page/Session
Layer 2 Would be original Page
Layer 1 would be Original page/s includes

Result:

Level 3
Level 2
Level 1


TestL2.asp
<%
Session("PleaseGodWork")="Level 3<br>"
server (www.tek-tips.com).execute "testl3.asp"
response.write "Level 1"
%>


TestL3.asp
<!--#include File="testl4.asp"-->
<%
response.write "Level 2<br>"
%>


TestL4.asp
<%
response.write Session("PleaseGodWork")
%>



Added to sessions - more psuedo code
Possibly reconsidering: may need recompiled asp (www.tek-tips.com).dll ideally.

Will want to check with example.

going to generate example now.



Could 10 lines change your life?
'This could be SessionLayer.asp a n-tier layer maybe?


LocalDomain="www.something.co.nz (http:)"
LocalFolder=:c\inetpub\wwwroot\something"

PageURLName="PageURL"
PageURL=request(PageURLName)

SessionKeyName="Sessid"
Sessionkey=request(SessionKeyName)

Page=TranslateToLocalPage(LocalFolder,LocalDomain, PageURL)
PageData=GetpageWithsession(Page,SessionKey)
PageData=TranslateToLinkswithSessioninURL(LocalDom ain,strPage)

response.write PageData

or something like that

Note to architect: could add remote domain, so you can grab the XML feed via local server to speed it up.

'CalledSublayer.asp e.g. fetched with webXML or similar with ASP
Callpage=Request("CallPage")
Session=Request("Seskey")
'Put session back

'Call page
execute CallPage

'feed is then given back to parent layer


To Microsoft (www.tek-tips.com): feedback@mss.co.nz (feedback@mss.co.nz)

Sessions on ASP Could be partly fixed:
www.creightonbrown.co.nz (http://www.creightonbrown.co.nz/)



Idea: Programming Solutions (www.tek-tips.com) ASP Fixing Stateless state with ASP
Page Translation of stateless language to preserve state

By Creighton Brown www.digitalbuilder.co.nz (http://www.digitalbuilder.co.nz/)

Dated 2005-07-25

To:
webmaster@ddj.com (webmaster@ddj.com)
www.ddj.com/ (http:)

toplas@acm.org (toplas@acm.org)
www.cs.wustl.edu (www.cs.wustl.edu)

s.roffel@elsevier.com (s.roffel@elsevier.com)

www.elsevier.com (www.elsevier.com)

industry@mediadesign.school.nz (industry@mediadesign.school.nz)

reece@netpulse.co.nz (reece@netpulse.co.nz)

Problem:
Session reference is not automatically passed with ASP.

Solution:
1. Use WebXML Service to download page
2. Regular expressions (www.tek-tips.com) or link harvesting is done on the page
3. The harvested links are iterated through links inserting session reference. May require different circuits e.g. if then or otherwise for different placement e.g. & or ?
3. Session Reference could be a virtual key or assignable key which is then outputted in the links
4. When a link is clicked the Translation SessionID is then reinserted into the next page:

Note: translation may vary, early guestimate 0.4-0.8 seconds/page

Translator Page
Overview:
Load Translator and pass in From URL

www.creightonbrown.co.nz (http://www.creightonbrown.co.nz)


[Reported amounts vary]
CreightonBrown (5692)
375288 2005-07-25 23:18:00 b plod (107)
375289 2005-07-25 23:41:00 l bartsdadhomer (80)
375290 2005-07-26 00:29:00 So what does that all mean in laymans terms? Chilling_Silence (9)
375291 2005-07-26 00:52:00 It's a recipe for making a cake that contains a lot of fruit. vinref (6194)
375292 2005-07-26 00:54:00 So what does that all mean in laymans terms?

My Tutor at Media design school was to say 'A Problem with ASP is that its stateless' [It does not have a way to track the user very well]

You can insert SessionIDs automatically in the URL to preserve state

To maintain 'state' you need a way to track someone.

if cookies are not available then state would not be possible with cookies or sessions, which use cookies.

The option then is another reference such as either data in the page or reference.

A common resolution is a page.asp?SessionID=x in the Querystring

PHP has this, ASP.NET has this but to implement it on ASP Is usually quite hard

This will allow automatic sessionID insertion.

Please note: it may require certain adjustments of code, a script could be generated to replace some of the code to be compatible automatically and archive the old variables

e.g. Passing IP of the client into Layer 2
CreightonBrown (5692)
375293 2005-07-26 00:57:00 Well, I think that clears it up for everyone :confused: Metla (12)
375294 2005-07-26 01:04:00 Well, I think that clears it up for everyone :confused:

Sorry metla, its more of a website programmer thing I suppose.

I hope your business is going well.
CreightonBrown (5692)
375295 2005-07-26 01:05:00 My Tutor at Media design school was to say 'A Problem with ASP is that its stateless' [It does not have a way to track the user very well]

You can insert SessionIDs automatically in the URL to preserve state

To maintain 'state' you need a way to track someone.

if cookies are not available then state would not be possible with cookies or sessions, which use cookies.

The option then is another reference such as either data in the page or reference.

A common resolution is a page.asp?SessionID=x in the Querystring

PHP has this, ASP.NET has this but to implement it on ASP Is usually quite hard

This will allow automatic sessionID insertion.

Please note: it may require certain adjustments of code, a script could be generated to replace some of the code to be compatible automatically and archive the old variables

e.g. Passing IP of the client into Layer 2

Maybe you should go with PHP, or Rails or something better like that.

Is displaying sessionid in the url a good idea?
vinref (6194)
375296 2005-07-26 01:13:00 If strCookieValueSet = strCookieValueRead Then
Response.Write "Cookies Are Supported!"
Else
Response.Write "Cookies Are Not Supported!"
End If
Rob99 (151)
1 2