1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Sharing session values from asp.net page to classic asp page?

Discussion in 'C#' started by binici, Jan 5, 2007.

  1. #1
    Hello all!

    I am in a delima here. I have a membersonly section that our users log into. I am passing a tokenkey to verify the session and to prevent others from hacking, sharing, ect info. I am setting the tokenkey to a session.item("sesTokenKey") in the codebehind.

    Now we created a page in classic asp, which we need to request("Tokenkey"), which is working fine by passing the arguements via the link, but I need to match it by verifying the session value, from the asp.net main page.

    In classic asp its session.content("").

    Is there a way around this? I hope I made sense.

    Thanks,

    Robert
     
    binici, Jan 5, 2007 IP
  2. Free Born John

    Free Born John Guest

    Messages:
    111
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hi,

    as they'er effectively running in two different application spaces I don't believe the session can be shared. Try saving it in the database and passing the "encrypted) key in the querystring
     
    Free Born John, Jan 6, 2007 IP
  3. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #3
    You can't directly share the session scope between classic and .net - but you can use some hidden trickery. you can either store it in a hidden input, then on your classic file just request.form("hidden"). Or you could save it to a DB Record, and just pass the ID of the record you just created via QuerySTring. Or you can save a temp file - and have asp read the file's token data. Or you could both be hitting the same COM object which would/could act as a session provider. Lots of options :)
     
    ccoonen, Jan 7, 2007 IP
  4. binici

    binici Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4

    Thanks! I used the asp:hiddenfield control and placed all my values in them and then on the postback I request.form, which leads me to my next problem, which I am currently giong to post.
     
    binici, Jan 8, 2007 IP
  5. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Bring It on :)
     
    ccoonen, Jan 9, 2007 IP
  6. MrWize

    MrWize Peon

    Messages:
    54
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    .... or, just store it in a regular cookie, that works too ....

    cya,
    /PatrikB
     
    MrWize, Jan 11, 2007 IP
  7. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Cookies wouldn't really be a good option. Posting a form wouldn't be that great either as asp.net has a different notion of posts than classic asp. There have been a few listed here, that I would go with.

    1) store session data in a DB and pass the primary key of the record via querystring to the next application

    2) Pass the values in a querystring.


    Good luck...
     
    ServerUnion, Jan 11, 2007 IP
  8. binici

    binici Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ya, after countless debate and testing (security wise and performance wise) passing them as values and then collecting and settings is the best way.

    Thanks everyone! :D
     
    binici, Jan 11, 2007 IP