Tech Off Thread

6 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Transferring session state from ASP to ASP.NET 2 and back?

Back to Forum: Tech Off
  • User profile image
    SlackmasterK

    Is it possible to embed data in a session state (i.e. session(x)=x), and transfer via server.transfer this session variable from a classic ASP page to an ASP.NET 2.0 page?  Is it possible to go the opposite direction? Thanks.

  • User profile image
    W3bbo

    Nope, ASP and ASP.NET are totally different entities, similar in name only.

    The only way to exchange data between them is either via Cookies or some backend store.

    I think you can modify ASP to use a SQL Server to store session state, then share it with ASP.NET, but I don't know.

    For small amounts of data, your best bet is with Cookies, but remember they're a client-side feature and cannot be trusted or relied upon

  • User profile image
    blowdart

    W3bbo wrote:


    For small amounts of data, your best bet is with Cookies, but remember they're a client-side feature and cannot be trusted or relied upon



    Or you just iterate the session collection in each and put them on hidden form fields, if you are transfering via form submissions.

    However that doesn't update live of course

    There's also an work around on MSDN

    This works via cookies and a little code

  • User profile image
    W3bbo

    blowdart wrote:
    
    W3bbo wrote:

    For small amounts of data, your best bet is with Cookies, but remember they're a client-side feature and cannot be trusted or relied upon



    Or you just iterate the session collection in each and put them on hidden form fields, if you are transfering via form submissions.


    But that still depends on the client complying, you can't trust nor rely on it.

  • User profile image
    blowdart

    W3bbo wrote:
    
    blowdart wrote:
    W3bbo wrote:

    For small amounts of data, your best bet is with Cookies, but remember they're a client-side feature and cannot be trusted or relied upon



    Or you just iterate the session collection in each and put them on hidden form fields, if you are transfering via form submissions.


    But that still depends on the client complying, you can't trust nor rely on it.


    Nor can you trust cookies. So add a nonce or checksum

  • User profile image
    Matthew van Eerde

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.